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 1: Line 1:
Let's write our first PHP code.
Let's write our first PHP code.
<syntaxhighlight lang="bash" line>
<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="bash" line>
<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>";
?>