mnb93
asked on
Return Array Elements that contain...
array (
[1] => 'uy87yh879sf s9d08fusdf 980dsf98 21/05/2006jidosfj89sd9 89uds9'
[2] => 'uy8/05/2006jidosfj89sd9 89uds9'
[3] => 'uy87yh879sf s9d08fusdf 980dsf98 21/089uds9'
[4] => 'uy87yh 21/05/2006jidosfj89sd9 89uds9'
[5] => '21/05/20069'
[6] => ' 21/05/2006jido'
)
Returns 1,5,6
That is what I would like.
How would I go about accomplishing this?
[1] => 'uy87yh879sf s9d08fusdf 980dsf98 21/05/2006jidosfj89sd9 89uds9'
[2] => 'uy8/05/2006jidosfj89sd9 89uds9'
[3] => 'uy87yh879sf s9d08fusdf 980dsf98 21/089uds9'
[4] => 'uy87yh 21/05/2006jidosfj89sd9 89uds9'
[5] => '21/05/20069'
[6] => ' 21/05/2006jido'
)
Returns 1,5,6
That is what I would like.
How would I go about accomplishing this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
$match = preg_grep('/21\/05\/2006/'
var_dump($match);
If you want the keys, you can add:
$keys = array_keys($match);
http://php.net/preg_grep