filmov
tv
19. PHP Array Functions-6 | array_flip , array_intersect and its variations - ATIBlog

Показать описание
Array functions -6
array_flip ( array $arr )
array_intersect (array $arr1 , array $arr2, array $arr3 , ……)
-- same like array_diff() (checks for the similarities of values)
array_intersect_assoc (array $arr1 , array $arr2, array $arr3 , ….)
-- same like array_diff_assoc() (checks for the similarities of
keys and values)
array_intersect_key (array $arr1 , array $arr2, array $arr3 , …..)
-- same like array_diff_key() (checks for the similarities of
keys)
array_intersect_uassoc (array $arr1 , array $arr2,array $arr3 , ….)
-- same like array_diff_uassoc() (checks for the similarities of
keys and values with user defined callback function)
array_intersect_ukey (array $arr1 , array $arr2, array $arr3 , ..)
-- same like array_diff_ukey() (checks for the similarities
of keys with user defined callback function)
1. array_flip()
This function is used to flip the array with the keys and values.
It takes one parameter that is an array.
The returned array will contain the flipped elements. The values will be the keys and the keys will be the values.
2. array_intersect() and its variations
Same like array_diff() and its variations . But instead of the difference, it checks for the similarities.
array_flip ( array $arr )
array_intersect (array $arr1 , array $arr2, array $arr3 , ……)
-- same like array_diff() (checks for the similarities of values)
array_intersect_assoc (array $arr1 , array $arr2, array $arr3 , ….)
-- same like array_diff_assoc() (checks for the similarities of
keys and values)
array_intersect_key (array $arr1 , array $arr2, array $arr3 , …..)
-- same like array_diff_key() (checks for the similarities of
keys)
array_intersect_uassoc (array $arr1 , array $arr2,array $arr3 , ….)
-- same like array_diff_uassoc() (checks for the similarities of
keys and values with user defined callback function)
array_intersect_ukey (array $arr1 , array $arr2, array $arr3 , ..)
-- same like array_diff_ukey() (checks for the similarities
of keys with user defined callback function)
1. array_flip()
This function is used to flip the array with the keys and values.
It takes one parameter that is an array.
The returned array will contain the flipped elements. The values will be the keys and the keys will be the values.
2. array_intersect() and its variations
Same like array_diff() and its variations . But instead of the difference, it checks for the similarities.
Комментарии