3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function prepareSlug( $slug ) { $slug = preg_replace( '/[^A-Za-z0-9\s]/', '', $slug ); return trim( str_replace( ' ', '-', $slug ) ); } echo prepareSlug( 'aoin 2. !#$&%/92 \'*?0 ' );
Output for 4.3.0 - 7.1.0
aoin--2-92-0-