Name

array_combine

Synopsis

array array_combine(array keys, array values)

Returns an array created by using each element in the keys array as the key and the element in the values array as the value. If either array has no elements, if the number of elements in each array differs, or if an element exists in one array but not in the other, false is returned.

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.