Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

array_search in php


<?php
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');

$key = array_search('green', $array); // $key = 2;
$key = array_search('red', $array);   // $key = 1;
?>

Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php
ADD COMMENT
Topic
Name
7+4 =