Jump to content

[SOLVED] find more (what should i change)


asmith

Recommended Posts

$ aa = array( "1-john","67-john","22-brown");
$b = "john";


preg_match("/([0-9]+)-$b/i",implode(",",$aa),$result)


 

the $result output :    array ("1-john");

 

it is exactlly what i want ,

what should i change the code to give me all the john's in array ? 

like :

 

array ("1-john","67-john") ;

 

  thanks

 

 

Link to comment
https://forums.phpfreaks.com/topic/80096-solved-find-more-what-should-i-change/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.