$str = ltrim($str,'0');

would be more efficient.

On Thu, 23 May 2002, Michael Sims wrote:

> On Thu, 23 May 2002 09:26:05 -0700 (PDT), you wrote:
>
> >Does anybody have a clever and efficient way of
> >getting rid of leading zeroes in a string?
>
> How about:
>
> $str = preg_replace("/^0+/","",$str);
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to