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

Beyond The Basics?

+

+shift and unshift chops/prepends the beginning of the array
+
\n"; + + /* shift a value from an array */ + $a = array_shift($arr); + echo $a . "

\n"; + + /* unshift an element, this func returns the element count */ + $c = array_unshift($arr, $a); + print_r($arr); + echo "

\n"; +?> + +pop and push
+
\n"; + + /* push back an element, this func returns the element count */ + $c = array_push($arr, "foo"); + $c = array_push($arr, "bar"); + print_r($arr); +?> +

+ + + -- cgit v1.2.3