Variable Visions

Articles PHP PHP-preg-replace-for-adding-hyphens-to-URL-field


tutorials - PHP and Web-Development.

PHP preg_replace for adding hyphens to URL field

Published Thu. Aug. 02, 2012


Set this variable eqaul to your POST value for URL title and it will automatically add hyphens where spaces are found.

$urltitle = preg_replace('/[^A-Za-z0-9-]+/', '-', $urltitle);


Tag(s): PHP, preg_replace, query string urls



RECENT ARTICLES:

PUBLISHED ON 01.19.23arrowAlarm Timer with Vanilla Javascript

PUBLISHED ON 01.13.23arrowJavascript Game using Phaser IO

TAGS

CATEGORIES