From 1bad4fc00814e2c03ecadaa7faf93c6372f5bd30 Mon Sep 17 00:00:00 2001 From: Kyle Kaminski Date: Sun, 16 Jun 2013 03:25:26 -0500 Subject: initial commit --- control.php | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 control.php (limited to 'control.php') diff --git a/control.php b/control.php new file mode 100644 index 0000000..8e608e2 --- /dev/null +++ b/control.php @@ -0,0 +1,56 @@ + + + +Hacker's Corner + + + +

Please Don't Fear!

+Sandbox: Let's Roll!
+

+"; + + switch ($pi) + { + case 1.618: + break; + case 3.14159: + echo "cought it.
"; + break; + default: + echo "how could this happen?
"; + break; + } + + /* while and for are straightforward, foreach is interesting, it allows us + * to loop through assosiative arrays, aka key-value pair */ + $myarr = array("world" => "evil", "bro" => "ski", "he" => "is good man"); + foreach ($myarr as $value) + echo "the value is \"{$value}\"
"; + + echo "
"; + foreach ($myarr as $key => $value) /* fucking weird */ + echo "at {$key} the value is \"{$value}\"
"; + + echo '
$myarr points to "' . current($myarr) . "\".
"; + reset($myarr); + next($myarr); + echo '$myarr now points to "' . current($myarr) . "\".
"; + + /* incrementing pointer */ + while ($str = current($myarr)) + { + echo $str . ", "; + next($myarr); + } +?> +

+ + + -- cgit v1.2.3