FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Need help with updating ereg_replace function -> to preg_replace
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Need help with updating ereg_replace function -> to preg_replace [message #180584 is a reply to message #180582] Fri, 01 March 2013 14:17 Go to previous messageGo to previous message
Christoph Becker is currently offline  Christoph Becker
Messages: 91
Registered: June 2012
Karma:
Member
daveh wrote:

> I'm totally confused none of the examples I've googled seem to help with fixing the following line of code:
>
> $myfunc = ereg_replace("0+$", "", $data);
>
> I've tried $myfunc = preg_replace("/0+$/", "/", $data);

You should try the following:

$myfunc = preg_replace('/0+$/', '', $data);

If you have more ereg_*() to replace, you should really learn the
workings of ereg_*() /and/ preg_*() /and/ string literals to be able to
transcribe them; the manual on <http://www.php.net/manual/en/> is a good
lecture. Just googling for some examples probably won't suffice.

--
Christoph M. Becker
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Other source for help?
Next Topic: returning values from a 2d array
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 04:37:30 GMT 2024

Total time taken to generate the page: 0.04029 seconds