SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2009
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Deprecated: Function ereg_replace() is deprecated

    Can someone please tell me how to fix this error in php?

    PHP Code:
    $sBaseRoot0=ereg_replace($sBaseVirtual0,"",$sBase0); //output: "c:/inetpub/wwwroot"
    if($sBase1!="")$sBaseRoot1=ereg_replace($sBaseVirtual1,"",$sBase1);
    if(
    $sBase2!="")$sBaseRoot2=ereg_replace($sBaseVirtual2,"",$sBase2); 
    if(
    $sBase3!="")$sBaseRoot3=ereg_replace($sBaseVirtual3,"",$sBase3); 

  2. #2
    SitePoint Member
    Join Date
    Sep 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    why not use str_replace to change ereg_replace it will do the same work ereg_replace will do

  3. #3
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,495
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    http://www.php.net/ereg_replace

    The manual gives you the suggested alternative. Although in this case I'd follow prince55l's suggestion.


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
  •