Is there such a thing as an array_search wildcard? Say I want to find anything
beginning with RE and having zero or more characters following it, how would I do that?
$found=array();
foreach($array as $key = $value) {
if(ereg('RE.+',$value)) { // optionaly use eregi for case
insensitiveness
$found[$key]=$value;
}
}
Liam Gibbs wrote:
Is there such a thing as an array_search wildcard? Say I want to find anything beginning with RE and having zero
$found=array();
foreach($array as $key = $value) {
if(ereg('RE.+',$value)) { // optionaly use eregi for case
insensitiveness
$found[$key]=$value;
}
}
Thanks, Marek. With some minor adjustments, this worked out fine!
--
PHP General Mailing List (http://www.php.net/)
To
3 matches
Mail list logo