array_add :
array_add function is used to add a key/value pair to the array.It will add only when there is no such key available in the existing array
Example:
$array = array('foo' => 'bar');
$array = array_add($array, 'key', 'value');
array_divide:
The array_divide function returns 2 arrays .First array will return the keys and second array will return the value of original array.
Example:
$array = array('foo' => 'bar');
list($keys, $values) = array_divide($array);
array_sort:
array_sort:
The array_sort function is used to sort the array from given array.
Example:
$array = array(
array('name' => 'Jill'),
array('name' => 'Barry'),
);
$array = array_values(array_sort($array, function($value)
{
return $value['name'];
}));
0 Comment(s)