array_search Searches the array for a given value and returns the corresponding key if successful : Array Function : Data Structure PHP Source Code


PHP Source Code » Data Structure » Array Function »

 

array_search Searches the array for a given value and returns the corresponding key if successful




<?php
   $state["Ohio""March 1";
   $state["Delaware""December 7";
   $state["Pennsylvania""December 12";
   $founded = array_search("December 7", $state);
   if ($foundedecho "The state $founded was founded on $state[$founded]";
?>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Data Structure
» Array Function