Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2014
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Need Help Fixing "Deprecated" Problem

    Hi,

    I just installed a new script on my website and I'm getting this message:

    Deprecated: Function ereg_replace() is deprecated in /home/content/68/9317268/html/YourSite/seourls.php on line 23

    This is the coding that's on line 23:

    $return = trim(ereg_replace(' +',' ',preg_replace('/[^a-zA-Z0-9\s]/','',strtolower($input))));

    If you can help me I would greatly appreciate it. Thanks.

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    363
    Thanks
    0
    Thanked 18 Times in 18 Posts
    You can replace ereg_replace with a similar preg_replace
    PHP Code:
    $return trim(preg_replace('~\s+~'' 'preg_replace('~[^a-z0-9\s]+~/'''strtolower($input)))); 
    or add another pattern/replacement to the existing preg_replace
    PHP Code:
    $return trim(preg_replace(array('~[^a-z0-9\s]+~''~\s+~'), array(''' '), strtolower($input))); 

  • Users who have thanked schleppel for this post:

    gregdavidson (06-07-2014)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •