Kasuke_Akira Posted July 12, 2006 Share Posted July 12, 2006 ok i have this:'/\[evilgrin\]/is',in an array.i know what the /i does, but i am curious what the /s is doing and also i am curious if there is a way so that when the ereg_replace() function replaces what it does, if there is something that makes it to where ereg_replace() has to find the exact word. like if [evilgrin] is touching other letters like this : hello[evilgrin] , that it won't replace the [evilgrin]; i want it to only replace [evilgrin] if it is by itself.thanks. hope you understand what i mean, im basically looking for another '/*' option that allows this. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/14419-string-stuff/ Share on other sites More sharing options...
GingerRobot Posted July 12, 2006 Share Posted July 12, 2006 You'll want to make the pattern:$pattern = '/\s\[evilgrin\]\s/is';the \s i added means any whitespace character.for information on the modifiers, look at the manual:http://uk.php.net/manual/en/reference.pcre.pattern.modifiers.php Quote Link to comment https://forums.phpfreaks.com/topic/14419-string-stuff/#findComment-56995 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.