<?PHP/*//Definition $attr = Array (All-in-one), $attr [] = 1; $attr = Array ("One" = "Hello");//array value $attr[0]; $attr ["One"]//array traversal for () foreach () each () list ()*///4. Pointer Traversal/*$attr = Array ("One" = "aaaa", "one" = "bbbb", "three" = "CCCC", 10,10);*///Echo Current ($attr)//echo key ($ATTR)/////////Key//next ($attr) of the current element,//The pointer inside the array is pointed to the next (Move Down)//prev ($ attr); Point the pointer inside the array to the previous (move Up)//end ($attr); Point the pointer to the last//reset ($attr); Reset the pointer/*While (Next ($attr)) {echo-current ($attr). " <br> ";}*//*do{Echo Current ($attr). " <br> ";} while (Next ($attr))*///Global Variables/*$a = 10;function Show () {$a = 8; Global $a; echo $a;} Show ();*///Var_dump ($_server);//var_dump ($_env);//$_post//Submitted post value $_get//Submit Get value $_request//Commit GET or POST value//$_files User-submitted file information//var_dump ($_files);//Array function (method)//echo count ($attr); Gets the number of array elements//var_dump (In_array ("Aaaac", $attr)); Determines whether the element is inside the array//$attr = Array_reverse ($attr); Flip array//$attr = Array_unique ($attr); The elements of the array are de-//unset ($attr ["the"]); Delete an element in the array//$attr = Array (1,2,3,4,5,6),//$attr 1 = Array (9,10),//unset ($attr [2]),//$attr = Array_values ($attr); Re-establish index//$attr = Array_merge ($attr, $attr 1); Merge array//add element//array_push to Array ($attr, 10); Append, function Way//$attr [] = 10; How to assign a value?><!--<form action= "test.php" method= "post" enctype= "Multipart/form-data" > <input type= "text" Name= " UID "/> <input type=" file "name=" file "/> <input type=" Submit "value=" Submit "/></form>-->
View Code
PHP pointer traversal, predefined arrays, and common functions