You are here: Re: numberlength « PHP Language « IT news, forums, messages
Re: numberlength

Posted by Richard Scrivens on 05/10/05 12:31

You could use something like:

while(strlen($myNumber) < 4){
$myNumber = "0" . $myNumber;
}

"Terje" <terje@cyberfactory.no> wrote in message
news:vV_fe.9641$SL4.218285@news4.e.nsc.no...
> Here in norway we have a four digit postalnumber, often this is 7800 an so
> on. But in some parts of norway we have 511 an postalnumber with 2-3
> numbers. The problem is that I need to display the 511 as a four digit
> number like 0511. Is there anyway I can set the length of an int string?
>
> Terje
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация