<?php $strings = array( 'this is a string', 'this is $ a string', 'this is 12 string', 'this is $12.99 string', ); foreach ($strings as $string) { var_dump(strtolower(preg_replace('#[\s]+#', '-', preg_replace('#[^a-z0-9\-\s]#', '', $string)))); }
You have javascript disabled. You will not be able to edit any code.