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 06.1.23arrowBuilding a JavaScript Metronome using Open AI Chat GPT

PUBLISHED ON 05.15.23arrowHow Do I Remove Footage Gaps in Adobe Premiere

TAGS

CATEGORIES