SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Convert eregi_replace to preg_replace

    Hi guys,

    My host has recently upgraded to PHP 5.3 - unfortunately this has created a lot of PHP warnings on my site.

    Namely:
    Deprecated: Function eregi() is deprecated

    I'm a complete newbie when it comes to writing PHP would any gurus be able to convert these lines to "preg_replace" it's my understanding that this will then fix the warnings.

    PHP Code:
    $path eregi_replace('^index2?.php'''$path); 
    PHP Code:
    $newurl eregi_replace("(&|\?)$var=[^&]*"'\\1'$url); 
    PHP Code:
    $newurl eregi_replace("(&|\?)$var=$value(&|\$)"'\\1\\2'$url); 
    Thank you so much for any help!

  2. #2
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    managed to resolve hopefully. This post was of great help for anyone stuck with a similar issue.
    http://www.devthought.com/2009/06/09...ors-in-php-53/

  3. #3
    SitePoint Member
    Join Date
    Jun 2012
    Location
    Somerset, UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just the answer I need. I got my hosting to return to 5.2 for short term cure.

    ,


Bookmarks

Posting Permissions

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