Understanding PHP basics: Difference between revisions

From Leechfinger
Jump to navigationJump to search
Qais (talk | contribs)
No edit summary
Qais (talk | contribs)
Line 1: Line 1:
== Get PHP info ==
== Get PHP info ==
<syntaxhighlight lang="bash" line>
<syntaxhighlight lang="php" line>
<?php
<?php
  phpinfo();
  phpinfo();
Line 11: Line 11:
?>
?>
</syntaxhighlight>
</syntaxhighlight>
== Storing values in a variable ==
== Storing values in a variable ==
<syntaxhighlight lang="PHP" line>
<syntaxhighlight lang="PHP" line>

Revision as of 14:27, 25 May 2024

Get PHP info

<?php
 phpinfo();
?>

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>";
?>