![]() |
|
[PHP] Convert String to url friendly string - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183) +---- Thread: [PHP] Convert String to url friendly string (/showthread.php?tid=2855082) |
Convert String to url friendly string - Webman.io - Sep 11, 2012 How can I somehow convert "a 16134 !#¤ toko5 14&!G90 into like a-16134-toko5-14-G90 or something like that, so that it can be used as a part of the url. * - QuantumTunnel - Sep 11, 2012 Look it up on google preg functions in php :) Just use PHP's documentation you won't learn anything unless you go research it yourself :) * - CarrotMilk - Sep 11, 2012 http://cubiq.org/the-perfect-php-clean-url-generator If you google well enough, someone else has ALWAYS made a function * - Dave85 - Sep 11, 2012 use this function: PHP Code * - Cida - Sep 11, 2012 With the preg_replace() function. PHP Code * - houseinn2 - Sep 11, 2012 put your string in one variable. make another variable valid char like "abc...xyz.ABC..XYZ012..9". Check if the char in ur string is contained in valid char. if yes,put it as it is else,"-" * - Webman.io - Sep 12, 2012 Thanks a lot to all of you. I got this solved. :YEAH!: |