3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $samp = "This is an . examp-le tex't using & my ' - / Regex expression"; $samp = preg_replace('/[^A-Z0-9\'- ]/i', "", $samp); $samp = str_replace(" "," ",$samp); $jk = explode(" ",$samp); $i = sizeof($jk); $j = 0; $array=""; for($j=0;$j<$i-1;$j++) { $array[] = $jk[$j]." ".$jk[$j+1]; } print_r($array);
Output for 4.3.11 - 7.1.0
Warning: preg_replace(): Compilation failed: range out of order in character class at offset 10 in /in/RvvNM on line 3
Output for 4.3.0 - 4.3.10
Warning: Compilation failed: range out of order in character class at offset 10 in /in/RvvNM on line 3