PHP pointer traversal, predefined arrays, and common functions

Source: Internet
Author: User

<?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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.