Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dylan Lopez
Added: Mar 27, 2018 6:21 PM
Views: 13
return array
  1. $my_string = "I am with a [id]123[/id] and [id]456[/id]";
  2. preg_match_all("~\[id\](.*?)\[\/id\]~",$my_string,$m);
  3. print_r($m[1]);