- Foreach ($ arr as $ key => $ value)
- {
- Echo $ value ."
";
- }
2) when $ arr [] is assigned a value, the array subscript uses the current maximum subscript + 1 ($ arr [maximum + 1]) as the subscript. example:
$value) { echo $key.' ='.$value." "; } //output:/*0 =11 =str2 =4 =45 =xint2 =76 =xx*/?>4. in php, the array is automatically added, which is different from the 5 in c ++. for the array function 1, count counts the number of arrays. 2) isarray: determine whether a variable is an array. 3) split explode text. 4) unset destroys the elements of a variable or array. After unset is destroyed, the sequence of the array is not changed. 6. the array operator $ a + $ B adds array B to array a, except for the same key. The same key is not overwritten. The same is true for numeric subscripts.
'fsf','b'=>'fsdfss');$b=array('a'=>'china','b'=>'huc','c'=>'lengai');$c=$a+$b;print_r($c);//Array ( [a] => fsf => fsdfss [c] => lengai )?>Code description: $ a ==$ B array a and array B have the same key value $ a ===$ B array a and array B. Not only must the key value be the same, but the order be the same. $ A <> $ B array a is different from array B. $! = $ B array a and array B are incomplete. Let's sum up. I hope it will help you. To learn php programming, let's go to the programmer's home. |