TAV1702 Posted August 7, 2018 Report Posted August 7, 2018 So I am messing with some code to bring it up to snuff with php 7 needs. I have pretty :much got it all good to go but 1 line. Literally, 1 line. $message .= str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig, \$repl, '\\0')", '>' . $seg . '<'), 1, -1)); This code as we know just by looking at it is a pile of errors waiting to happen.I get the following error exactly as I had suspected I should. Quote Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead Now I have used the callback and everything in between and I get errors no matter what. The odd part is I have fixed no less than 25 of these in this code i am working on. However, this one is just sticking a boot in my @ss. I am not sure wh=y I can not get this one line out of all of them to work. It is probably something so simple and right under my nose. I have been working all night while laying in bed in the hospital and probably have just done to much for the night/day and just need to stop and ask like I have done here. What say ye code gurus? Quote
Administrators Nabeel Posted August 20, 2018 Administrators Report Posted August 20, 2018 What are the errors? And what exactly are you trying to do? That is a nasty regex Quote
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.