You are here: Re: [PHP] Formating « PHP « IT news, forums, messages
Re: [PHP] Formating

Posted by Jochem Maas on 09/28/19 11:20

Bruno B B Magalhães wrote:
> Hi everybody,
>
> I've searched the docs for a generic way to format strings and numbers...
>
> For example I have a brazilian zipcode witch is stored in database as
> 22252970 and must be formatted as NNNNN-NNN, where N is a number. Also
> I have a tax id with is also stored as numeric value only, for example
> 05117635472 and outputted as NNN.NNN.NNN-NN... Is that any way that I
> can do it generic, storing the formatting strings ('NNNNN- NNN') with
> languages strings, so it is localised and this would be parsed as:

I don't think the format string for such data should be bound to the locale,
i.e. a brazilian zipcode should be formatted as stated regardless of whether
I view a page in english, french or spanish, no?

also take a good look at sprintf(), printf() & co:
http://php.net/sprintf

>
> string::format($string, $format);
>
> Best Regards,
> Bruno B B Magalhaes
>

 

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

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