Fork me on GitHub
RSS
 

Posts Tagged ‘url safe’

How to make URL Safe strings for mod_rewrite using PHP

11 Jul

It’s relatively easy to make URL safe strings for use by mod_rewrite. Let’s use the example that you have a form that adds a new blog post to your site. When the user submits this form, you want to generate a URL safe string (based on the title of the blog post) for mod_rewrite to use. This little snippet will show you how this can be achieved in one line of code in PHP.
Read the rest of this entry »