Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-searchArray

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  searchArray   Lines 1847-1865 (18 lines) file  utils.php   Last mod: Fri 2021-05-14 21:45:07

function searchArray $needle$haystack$start=0$last=-)
        {
#-k     string search array
#-      look for the next occurance of the needle in a haystack
#-      start at record $start (default 0)
#-      end at record $last (default -1)
#-      return the key

        
$i 0;
        foreach ( 
$haystack as $k => $h )
                {
                if ((
$last != -1)  and  ($i $last)) return -1;
                if ((
$i >= $start)  and  (strpos(' '.$h$needle))) return $k;
                
$i++;
                }

        return -
1;
        }

?>