0

How can I convert / update the following regular expression functions to be valid in PHP 7:

$rawsub=ereg_replace("</*b>", "", $subject);

$qauthor=ereg_replace("<b>|</b>", "", $author);

$body=eregi_replace("<(mailto:)([^ >\n\t]+)>", "{phopen}a href=\"\\1\\2\"{phclose}\\2{phopen}/a{phclose}", $body);

$body=eregi_replace("<([http|news|ftp]+://[^ >\n\t]+)>", "{phopen}a href=\"\\1\"{phclose}\\1{phopen}/a{phclose}", $body);

$body=eregi_replace("<(/*($ForumAllowHTML) *[^>]*)>", "{phopen}\\1{phclose}", $body);
drupalfan
  • 123
  • 1
  • 5
  • These regular expression look like they lack delimiters (i.e. `/`)? Are these throwing errors? If so, please [edit] your question to include the errors. – Mr. Llama Apr 06 '17 at 15:27

1 Answers1

0

You can go for preg_replace() instead of using ereg_replace() and rewrite your pattern according to preg_replace(). For more details, you can visit this link below. preg_replace()

Difference between preg_replace() and ereg_replace()

Community
  • 1
  • 1