3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sourcestring="[img]http://miximoms.dev/static/uploads/n7krkqvkkr/1386778095zkn_playmobil-smooth-criminal.jpg[/img]"; preg_match_all('/\[img\]{1}\[/img\]/',$sourcestring,$match); $myMatches = ""; foreach($match[0] as $thisMatch){ echo "$thisMatch\n"; $myMatches .= "$thisMatch <br\>"; } echo $myMatches;
Output for 4.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: preg_match_all(): Unknown modifier 'g' in /in/MCGSQ on line 3 Warning: Invalid argument supplied for foreach() in /in/MCGSQ on line 7
Output for hhvm-3.10.0 - 3.12.0
Warning: Unknown modifier 'g': [/\[img\]{1}\[/img\]/] in /in/MCGSQ on line 3 Warning: Invalid argument supplied for foreach() in /in/MCGSQ on line 10
Output for 4.3.11
Warning: preg_match_all(): Unknown modifier 'g' in /in/MCGSQ on line 3
Output for 4.3.0 - 4.3.10
Warning: Unknown modifier 'g' in /in/MCGSQ on line 3 Warning: Invalid argument supplied for foreach() in /in/MCGSQ on line 7