3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $chapter_full_path = "/test/eeee/last/"; $chapter_path_name = "last"; $chapter_path_name_length=strlen($chapter_path_name); $oldParentFullPathLength = strlen($chapter_full_path) - $chapter_path_name_length; $oldParentFullPath=substr($chapter_full_path,0,$oldParentFullPathLength); echo $oldParentFullPath;
based on kNSQr
Output for 4.3.0 - 7.1.0
/test/eeee/l