petventh Posted October 16, 2011 Share Posted October 16, 2011 Please help me with this code. It keep appear in my website. "Warning: preg_match() [function.preg-match]: No ending delimiter '.' found in /home/kengsite/public_html/wp-content/plugins/statpress/statpress.php on line 1184" And this is how the line look like. if (!preg_match(".ico$", $urlRequested)) { return ''; } Link to comment https://forums.phpfreaks.com/topic/249195-warning-preg_match-functionpreg-match-no-ending-delimiter-found/ Share on other sites More sharing options...
teynon Posted October 16, 2011 Share Posted October 16, 2011 preg uses a character to define the beginning and end of the pattern try this: if (!preg_match("@.ico$@", $urlRequested)) { return ''; } @ is the beginning of the pattern matching string and therefore the end. In your example, the string is looking for . at the end. There is none so it gives you a warning. Link to comment https://forums.phpfreaks.com/topic/249195-warning-preg_match-functionpreg-match-no-ending-delimiter-found/#findComment-1279686 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.