php url single dash code example Example: php replace spaces with dash str_replace(' ', '-', $string);