poe Posted January 4, 2007 Share Posted January 4, 2007 how do i do a replace all occurances of 'w-l' to 'wlt'preg_replace("w-l","wlt",$cleanData);i get this error:Delimiter must not be alphanumeric or backslash Link to comment https://forums.phpfreaks.com/topic/32802-preg_replace/ Share on other sites More sharing options...
c4onastick Posted January 4, 2007 Share Posted January 4, 2007 Regular expressions require delimiters to tell it where the pattern starts and ends.[code]$cleanData = preg_replace('/w-l/', 'wlt', $cleanData);[/code]This tells the regex engine that the pattern is between the '/' characters. Link to comment https://forums.phpfreaks.com/topic/32802-preg_replace/#findComment-152734 Share on other sites More sharing options...
weknowtheworld Posted January 9, 2007 Share Posted January 9, 2007 preg_replace ( search_for, replace_with, your_data , optional_limit, optional_count ) Link to comment https://forums.phpfreaks.com/topic/32802-preg_replace/#findComment-156793 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.