/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Regular expression function that replaces spaces between words with hyphens. <?php function create_slug($string){ return $slug; } echo create_slug('does this thing work or not'); //returns 'does-this-thing-work-or-not' ?>
URL: http://css-tricks.com/snippets/php/create-url-slug-from-post-title/
Comments
