Jump to content

Deprecated: Function ereg_replace() is deprecated


MiWBC

Recommended Posts

Can anyone help me with this - I don't normally do coding.

 

I've just moved an old site onto new hosting and I'm getting this message: Deprecated: Function ereg_replace() is deprecated 

 

The code looks like this:

if( preg_match( '/sl/i', $sOption ) )

    $sContent = addslashes( $sContent );

  else

    $sContent = stripslashes( $sContent );

 

  $sContent = ereg_replace( "\r", '', $sContent );

 

  if( preg_match( '/len/i', $sOption ) )

    $sContent = checkLengthOfTxt( $sContent );

 

I changed it to look like this:

if( preg_match( '/sl/i', $sOption ) )

    $sContent = addslashes( $sContent );

  else

    $sContent = stripslashes( $sContent );

 

  $sContent = preg_replace( "\r", '', $sContent );

 

  if( preg_match( '/len/i', $sOption ) )

    $sContent = checkLengthOfTxt( $sContent );

 

But now get this warning message:

Warning: preg_replace() [function.preg-replace]: Empty regular expression 

 

I didn't build the site so I don't even know what the script is trying to do - forgive my ignorance!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.