Created
August 4, 2017 20:34
-
-
Save justyntemme/9847e0fd2c5b1a7d9a519cceed661305 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<form action="learnphp.php" method="GET"> | |
<b>Name :</b> <input type="text" name="name"> | |
</form> | |
<?php | |
echo("Hello world! <br>"); | |
echo("The time is: " . date('h:i:s') . "<br>"); | |
echo("Todays date is " . date('d/m/y') . '<br>'); | |
$myvar = " I am learning PHP!"; | |
if (3 < 5 ) { | |
echo("<br> Math is working!<br>"); | |
} else { | |
echo("<br> Match is broken <br>"); | |
} | |
echo(" $myvar"); | |
$myvar = ('New Var = ' . $myvar); | |
echo("New variable === " . $myvar); | |
///////////////////////////////////////////////////////////// | |
$names=array('justyn','whocares','does not matter'); | |
echo("<br> The only name that matters is" . $names[0] . " <br>"); | |
echo("<br> These names don't matter<br>"); | |
echo($names[1] . "<br> " . $names[2] . "<br>"); | |
echo("Arguemt passed as name" . $_GET['name'] . "<br>"); | |
showGlobals(); | |
function showGlobals() | |
{ | |
global $names; | |
echo("<br> global variable names is equeal to :" .$names[0] . "<b>"); | |
} | |
?> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment