3v4l.org

run code in 300+ PHP versions simultaneously
<?php $regex1 = "/[^0-9a-z\s]+/i"; // Search for everything that is not alphanumeric or whitespace $regex2 = "/\s+/"; // Search for whitespace $regex3 = "/-+$/"; // search for trailing dashes $text = "Hello World - This/That is (Test)"; // replace in turn, non-alpha with space, one or more spaces with dash, one or more trailing dashes with nothing $text2 = preg_replace([$regex1, $regex2, $regex3],[' ','-',''], $text); $text2 = strtolower($text2); echo $text2;
Output for git.master, git.master_jit, rfc.property-hooks
hello-world-this-that-is-test

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:
32.95 ms | 401 KiB | 8 Q