PHP function of the day: array_flip()

For day 15 of 21 in the “PHP Function of the day” series, I’m going to look at array_flip(). As you might guess, this function “flips” the array so that the key is the value and the value is the key.

Let’s take a look.


$joe = array(“fname”=>”Joe”,”lname”=>”Steinbring”,”website”=>””);


echo(“<br />”);


echo(“<br /><br />”);

$foods = array(“Beans”, “Apples”, “Wine”, “Pizza”);


echo(“<br />”);




See the output


You might have noticed that I missed this past Thursday and Friday’s posts.  I took an extended weekend, so I am posting them on Monday.  There should be just one week of these PHP function posts left.

Leave a Reply

Your email address will not be published. Required fields are marked *