From 6071e57cd962462e720f33ec7870810cd67ba528 Mon Sep 17 00:00:00 2001 From: afaqurk Date: Sat, 31 Aug 2013 23:29:51 -0400 Subject: spelling error on php function: var_dumb() = var_dump() --- php.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'php.html.markdown') diff --git a/php.html.markdown b/php.html.markdown index 1cc6d2c5..0ff31dd2 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -177,7 +177,7 @@ echo $x; // => 2 echo $z; // => 0 // Dumps type and value of variable to stdout -var_dumb($z); // prints int(0) +var_dump($z); // prints int(0) // Prints variable to stdout in human-readable format print_r($array); // prints: Array ( [0] => One [1] => Two [2] => Three ) -- cgit v1.2.3 From ba17d5b9877f324fa633c1670c49e6a867ba5734 Mon Sep 17 00:00:00 2001 From: afaqurk Date: Sat, 31 Aug 2013 23:44:15 -0400 Subject: Added unset function to arrays and variables. Added the unset function to show the varying effects of deleting/removing variables and elements of an array. --- php.html.markdown | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'php.html.markdown') diff --git a/php.html.markdown b/php.html.markdown index 0ff31dd2..19f507ad 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -59,6 +59,9 @@ $float = 1.234; $float = 1.2e3; $float = 7E-10; +// Delete variable +unset($int1) + // Arithmetic $sum = 1 + 1; // 2 $difference = 2 - 1; // 1 @@ -136,6 +139,11 @@ echo $associative['One']; // prints 1 $array = ['One', 'Two', 'Three']; echo $array[0]; // => "One" +// Add an element to the end of an array +$array[] = 'Four'; + +// Remove element from array +unset($array[3]); /******************************** * Output -- cgit v1.2.3