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 Quote Link to comment 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. Quote Link to comment 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 ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.