Concept

How can you extract array keys and values and compare arrays in PHP?

ComputerScienceOne / Iteration

"$keys = array_keys($arr);\n\n$vals = array_values($arr);\n\nprint_r($keys);\n\nprint_r($vals);\n\nwould print Array ( [0] => foo [1] => 4 [2] => 0 [3] => baz ) Array ( [0] => 5 [1] => bar [2] => 3.14 [3] => ten ) Finally, you can use the equality operators, == and === to compare arrays. The first is the loose equality operator and evaluates to true if the two compared arrays have the same key-value pairs while the second is the strict equality operator and is true only if the arrays have the same key/value pairs in the same order and are of the same type."

Related Ideas

How can you extract array keys and values and compare arrays in PHP? | ComputerScienceOne | Bifalgorithm | Bifalgorithm