Skip to content

Instantly share code, notes, and snippets.

@einnar82
Created December 15, 2021 06:26
Show Gist options
  • Save einnar82/875b33dcd46ae76ccd8a608afce1e387 to your computer and use it in GitHub Desktop.
Save einnar82/875b33dcd46ae76ccd8a608afce1e387 to your computer and use it in GitHub Desktop.
PHP refresher
<?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