Reply to Re: this function never pads integers with leading zeros - help

Your name:

Reply:


Posted by Jerry Stuckle on 09/02/06 14:23

comp.lang.php wrote:
> Joshie Surber wrote:
>
>>Have you tried forcing your INT into a STRING, or making sure it is a
>>string? If it is being treated as an INT padding is automatically
>>disregarded.
>
>
> How do you force an int into a string? In Java it would be:
>
> int stuff = 8;
> System.out.println(stuff.toString());
>
> Or something like that
>
> Phil
>
>

First of all, this is Java, not PHP. Two different languages which have
to be handled two different ways - don' t confuse the two. And BTW -
your example won't work for Java, either (no toString method for an int).

As to converting to a string - you can so something like:

$str = sprintf('%d', $var);

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original 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

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