+ Reply to Thread
Results 1 to 3 of 3

Thread: Deprecated: Function ereg_replace() is deprecated

  1. #1
    chriscrowe43 is offline x10Hosting Member chriscrowe43 is an unknown quantity at this point
    Join Date
    Aug 2011
    Posts
    21

    Deprecated: Function ereg_replace() is deprecated

    Im getting an error.
    Deprecated: Function ereg_replace() is deprecated in (site root) /wi_class_files/automakeLinks.php on line 26

    i have a pageing calling on a file containing this code.
    (lines 22-30) automakelinks.php

    class autoActiveLink {
    function makeActiveLink($originalString){

    $newString = ereg_replace("[[:alpha:]]+://[^<>[:space:]][[:alnum:]/]","<ahref=\"\\0\" target=\"_blank\">\\0</a>", $originalString);
    return $newString;
    }
    }
    ?>

    This error is showing up when ever i post a "blab" on the profile page. If i go into the database and delete the blab and refresh the webpage the error goes away. I know very little about php but have managed to make it this far. Please Please help me fix this. I believe its the last obsticle in my way from having any major building from being finished aside from tweeking appearance of the pages. thank you again for your help!1
    Attached Thumbnails Attached Thumbnails Deprecated: Function ereg_replace() is deprecated-pagepic.jpg  
    Last edited by chriscrowe43; 09-26-2011 at 01:04 PM.

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Deprecated: Function ereg_replace() is deprecated

    There's a previous thread on ereg deprecation. Start with the information there (all of it), and post back here if you need more help.
    Last edited by misson; 09-26-2011 at 01:41 PM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    Dead-i's Avatar
    Dead-i is offline Community Advocate Dead-i has a spectacular aura about
    Join Date
    Aug 2011
    Location
    United Kingdom
    Posts
    1,448

    Re: Deprecated: Function ereg_replace() is deprecated

    The alternative to ereg_replace is preg_replace:

    http://php.net/manual/en/function.preg-replace.php

+ Reply to Thread

Similar Threads

  1. why is my once working code saying its deprecated?
    By linkenpark51471 in forum Free Hosting
    Replies: 3
    Last Post: 09-18-2011, 09:29 PM
  2. Replies: 1
    Last Post: 09-09-2011, 08:23 AM
  3. PHP-errors, worked before. NOT deprecated.
    By verfone in forum Free Hosting
    Replies: 8
    Last Post: 07-22-2010, 09:00 AM
  4. ereg_replace and explode problem
    By learning_brain in forum Programming Help
    Replies: 5
    Last Post: 04-30-2010, 03:31 PM
  5. Replies: 2
    Last Post: 09-25-2009, 05:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers