3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function format_text($string) { $string = preg_replace('/(\*\*(.*?)\*\*)/', '<b>\\2</b>', $string); $string = preg_replace('/(##(.*?)##)/', '<em>\\2</em>', $string); return $string; } $before = "Focus on the **user** and all else will ##follow##."; $after = format_text($before); echo $after;
Output for 4.3.0 - 7.1.0
Focus on the <b>user</b> and all else will <em>follow</em>.