Understanding PHP basics: Difference between revisions

From Leechfinger
Jump to navigationJump to search
Qais (talk | contribs)
No edit summary
Qais (talk | contribs)
No edit summary
Line 3: Line 3:
<?php
<?php
  echo "Hello from PHP";
  echo "Hello from PHP";
?>
</syntaxhighlight>
== Storing values in a variable ==
<syntaxhighlight lang="bash" line>
<?php
$myName = "Kooka";
$friendsName = "Loopa";
echo "<p>I am $myName and I have a friend called $friendsName.</p>";
?>
?>
</syntaxhighlight>
</syntaxhighlight>
[[Category:PHP]]
[[Category:PHP]]

Revision as of 13:53, 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>";
?>