3v4l.org

run code in 200+ PHP versions simultaneously
<?php $main_string = "23/CSE/4/2014"; $sub_string = "CSE/4/2014"; echo str_replace($sub_string, '', $main_string); echo "\n"; $main_string = "CSE/4/2014/23"; $sub_string = "CSE/4/2014"; echo trim(str_replace($sub_string, '', $main_string), '/');
based on BlrV6
Output for 7.1.0 - 7.4.0
23/ 23