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 #180617 is a reply to message #180582] Thu, 07 March 2013 05:53 Go to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Fri, 01 Mar 2013 05:10:07 -0800, daveh wrote:

> Hello
>
> 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);

I suspect that the preg_replace() equivalent of the above ereg_replace is
more likely to be:

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

--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
[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: Fri Nov 22 04:45:01 GMT 2024

Total time taken to generate the page: 0.03888 seconds