3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = 'c1, c3, C5 DESC'; $order = "DESC"; $c = explode(",", $str); $s = preg_replace('/DESC$/', '', $c[2]); var_dump($s);
based on 8ZEdP
Output for 5.6.38 - 7.3.0rc3
string(4) " C5 "