Understanding PHP basics: Difference between revisions
From Leechfinger
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Let's write our first PHP code. | Let's write our first PHP code. | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="PHP" line> | ||
<?php | <?php | ||
echo "Hello from PHP"; | echo "Hello from PHP"; | ||
Line 6: | Line 6: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Storing values in a variable == | == Storing values in a variable == | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="PHP" line> | ||
<?php | <?php | ||
$myName = "Kooka"; | $myName = "Kooka"; |
Revision as of 13:54, 25 May 2024
Let's write our first PHP code.
<?php
echo "Hello from PHP";
?>
Storing values in a variable
<?php
$myName = "Kooka";
$friendsName = "Loopa";
echo "<p>I am $myName and I have a friend called $friendsName.</p>";
?>