3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "(Here {is [a] Special} Title)! & it's fine, right?"; echo preg_replace('~[^a-z]~', '_', strtolower($string)); // all non-letters become underscores echo "\n\n"; echo str_replace(' ', '_', preg_replace('~[^a-z ]+~', '', strtolower($string))); // notice the consecutive underscores echo "\n\n"; echo preg_replace(['~[^a-z ]+~', '~ +~'], ['', '_'], strtolower($string)); // notice no consecutive underscores
Output for git.master, git.master_jit, rfc.property-hooks
_here__is__a__special__title_____it_s_fine__right_ here_is_a_special_title__its_fine_right here_is_a_special_title_its_fine_right

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
26.35 ms | 405 KiB | 5 Q