Created
December 15, 2021 06:26
-
-
Save einnar82/875b33dcd46ae76ccd8a608afce1e387 to your computer and use it in GitHub Desktop.
PHP refresher
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
<?php | |
$name = 'rannie'; | |
print $name; | |
function greetPerson($person) | |
{ | |
// return '<br />hi '.$person; | |
return "<br />hi $person"; | |
} | |
$string = 'string'; | |
$float = 3.14; | |
$int = 10; | |
$array = [1, 2, 3]; | |
for ($i=0; $i < count($array); $i++) { | |
print $array[$i]; | |
} | |
if (true) { | |
# code... | |
} else if { | |
} else { | |
} | |
switch ($variable) { | |
case 'value': | |
# code... | |
break; | |
default: | |
# code... | |
break; | |
} | |
print greetPerson('johnny sins'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment