methods for initializing arrays: Unified initialization or initialization by item.
Ways to iterate through an array:
1. For loop
2. Do ... While statement
3. While statement
4. foreach
foreach ($arras$key=$val) { echo$key. " =". $val. " <br/> "; }
The key value in an array can be an integer or a string.
An array can store any data type.
Understanding content: Array Operators.
Array sorting issues:
Internal sorting:
1. Bubble sort
2. Select the Sorting method
3. Insert Sort method
4. Fast sorting method
External sort:
Questions about function Parameters:
When the formal parameter takes the address: Indicates that the address is passed, and the address in the original array passes through, changing the original value.
When the parameter does not take address: The default pass is a value pass, not an address pass, which is a new array pass, and does not alter the value of the original array.
Other knowledge:
Common functions:
1. Count
Count ($arr); // gets the length of the array
2, Is_array: Determine whether the array.
3. Print_r: Displays easy-to-understand information about a variable. If a string,integer , or floatis given, the variable value itself is printed. If an array is given , the keys and elements are displayed in a certain format. Object is similar to an array.
4. Var_dump: Returns the type and value of an expression.
5, Explode: Use one string to split another string.
6. Round: Rounding the specified number of digits for floating-point numbers.
7, unset: Destroy an element, you can also destroy a variable.
When a variable is destroyed in an array, the array is not automatically re-assembled, and the data corresponding to that key value in the array is undefined
8.How to turn off notice level tips in PHP:
1.php.ini file modified to: error_reporting = E_all & ~e_notice
2. Add code to the page where you want to suppress error prompts: error_reporting (e_all ^ e_notice);
PHP Learning Notes (a) array