The array_values() function in PHP takes an array and returns all it’s values as a numeric array.
$array = array('go' => 'green', 'stop' => 'red'); var_dump( array_values($array) ); /* Array (  => green  => red ) */
To replicate this functionality in Ruby, we need to use a Hash object, since arrays […]
The list() function in PHP is used to assign multiple variables as if they were an array. Technically, list() is not a function in PHP, it is a language construct.
Ruby has no real need for a function such as list(), as the same can be achieve using parallel assignment – […]
The in_array() function in PHP checks if a value exists in an array – returning true if it does, or false otherwise.
The last argument in this function forces a strict type check of the value in PHP. Since Ruby does not consider a Fixnum of 1 and a String of […]