I am new to php and installing this script on my server I get this

Deprecated: Function eregi_replace() is deprecated in C:\xampp\htdocs\playerlist.php on line 290

so when i find that line 290 this is what it is

$contents = eregi_replace("<!--%STATS_PLAYER%-->", $player_stats, $contents);

I have been trying to read on its replacement preg_replace but not quite understanding what it wants me to do.

this is what i have so far

$contents = preg_replace('/<!--%STATS_PLAYER%-->/i', $player_stats, $contents);

if any one could guide me along that would be nice

thanks

    from further reading i think i should be using this str_ireplace or am i wrong

      anybody please help i am still having issues trying to get this to display.

        basically getting a bunch of depreciated function errors and some division by 0 errors which i have fixed those.

        I am noticing that $contents = str_ireplace("<!--%STATS_PLAYER%-->", $player_stats, $contents); is working on replacing the eregi_replace as well as this
        $contents = preg_replace("/<!--%STATS_PLAYER%-->/i", $player_stats, $contents); (if i didnt have the / put in i would get a bunch of these <>

        so now that i got both working which is the best one to use the str_ireplace or the preg_replace???

          Since you aren't utilizing any regular expression syntax, the simple string replacement would be more efficient.

            ok thanks.. its been working like a charm so far.

              Write a Reply...