array search
Posted: Fri Apr 20, 2007 1:44 pm
hi, can someone please help me out with an array search function that would find any number surrounded with a "^" before and after?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$stack = array('test string ^3423432^', '^432423^ test string', 'dfdsffdsfd ^342342^');
$found = array_map(create_function('$stack', 'preg_match("#\^([0-9]+)\^#", $stack, $matches); return $matches[1];'), $stack);