InterviewSolution
Saved Bookmarks
| 1. |
How to get common values from two array in php? |
|
Answer» To select the common data from two arrays in PHP, you need to use the array_intersect() function. It compares the value of two given arrays, MATCHES them and RETURNS with the common values. Here’s an example: $a1=ARRAY("a"=>"red","b"=>"green","c"=>"BLUE","d"=>"YELLOW"); Array ( [a] => red ) |
|