Hayyel
05-11-2009, 02:30 AM
Hello,
I am in need of a way to search an array for a value that contains a word.
$colorList = array("first name","last name","complete name","address","white");
$find = array_search("last", $colorList);
echo $find // results in $find being empty.
I need it to answer like the whole value would:
$colorList = array("first name","last name","complete name","address","white");
$find = array_search("last name", $cololorList);
echo $find // 1
So I need a partial match of the value to return the key and a way count the keys containing the partial value.
I am in need of a way to search an array for a value that contains a word.
$colorList = array("first name","last name","complete name","address","white");
$find = array_search("last", $colorList);
echo $find // results in $find being empty.
I need it to answer like the whole value would:
$colorList = array("first name","last name","complete name","address","white");
$find = array_search("last name", $cololorList);
echo $find // 1
So I need a partial match of the value to return the key and a way count the keys containing the partial value.