Jump to content

Off Topic Code Question


TAV1702
 Share

Recommended Posts

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?

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...