?Array de-weight
$term = Array_column ($grade, ' term '), $term =array_flip (Array_flip ($term));p Rint_r ($term);
Effect:
Principle:
Array_flip ():
The function returns an inverted array, and if the same value occurs more than once, the last key name will be the value and all other key names are lost.
If the data type of the value in the original array is not a string or an integer, the function will error.
Two times the key and value exchange, because PHP does not allow the key name duplication, to achieve the effect of the deduplication.
The second method:
Print_r (Array_unique ($term));
The Array_unique () function shifts the duplicate values in the array and returns the result arrays.
When the values of several array elements are equal, only the first element is preserved, and the other elements are deleted.
The key name in the returned array is not changed.
PHP array de-weight/