3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $body = '📣shfdgkj fdsgjkhfgkj'; $body1 = preg_replace('(^(:mega:|📣))', '', $body); var_dump($body1); $megas = [':mega:', '📣']; foreach ($megas as $mega) { if (strpos($body, $mega) === 0) { $body2 = substr($body, strlen($mega)); break; } } var_dump($body2);
based on IU8fY
Output for 5.5.0 - 7.3.0beta1
string(19) "shfdgkj fdsgjkhfgkj" string(19) "shfdgkj fdsgjkhfgkj"