©  Steve Prettyman 2017

Steve Prettyman, PHP Arrays, 10.1007/978-1-4842-2556-1_6

6. PHP Functions—Comparing and Merging Arrays

Steve Prettyman

(1)Key West, Florida, USA

After completing this chapter, the student will be able to…

  • Create a simple PHP program which compares two arrays on a value, key, or with a user-defined function.

  • Create a simple PHP program which merges two arrays via union or intersection

In this chapter we will take a brief look at the PHP functions that compare and merge arrays. Many of these functions work with multiple array types (single, multidimensional, and/or associative).

All descriptions of the following functions are provided by the online PHP manual available at www.php.net . Brief examples using each function and a ...

Get PHP Arrays: Single, Multi-dimensional, Associative and Object Arrays in PHP 7 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.