CrystalSeabolt Posted August 24, 2015 Share Posted August 24, 2015 I'm trying to wrap my little head around replacing some deprecated preg_replaces and now I have this error... Warning: preg_replace_callback(): Modifier /e cannot be used with replacement callback in /include/parse.php on line 150 Here is line 150.... $text = preg_replace_callback('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', function ($matches) {return 'handle_img_tag(\'$1$3\')';}, $text); Can anyone show me the correct example? Quote Link to comment https://forums.phpfreaks.com/topic/297912-show-me-what-im-doing-wrong-with-preg_replace_callback/ Share on other sites More sharing options...
scootstah Posted August 24, 2015 Share Posted August 24, 2015 I think the error tells you pretty clearly what the problem is... Look at the error, then at your pattern. Look at the error, then at your pattern. Error...pattern... Quote Link to comment https://forums.phpfreaks.com/topic/297912-show-me-what-im-doing-wrong-with-preg_replace_callback/#findComment-1519526 Share on other sites More sharing options...
Ch0cu3r Posted August 24, 2015 Share Posted August 24, 2015 Did you not learn anything from your other topic? The process is the same for converting the preg_replace for images as it was for your urls. You should be able to use the same callback function I gave. Quote Link to comment https://forums.phpfreaks.com/topic/297912-show-me-what-im-doing-wrong-with-preg_replace_callback/#findComment-1519539 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.