Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> 01 zamiast 1 itd..., drukowanie 1=01 , 5=05 ,10=10
huntercs
post
Post #1





Grupa: Zarejestrowani
Postów: 94
Pomógł: 0
Dołączył: 6.02.2005

Ostrzeżenie: (0%)
-----


Jak w temacie to podchodzi pod jakis format wydruku typu print("nr: %d",$nr); tak bylo w C++ a w php nieumiem (IMG:http://forum.php.pl/style_emoticons/default/sadsmiley02.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
huntercs
post
Post #2





Grupa: Zarejestrowani
Postów: 94
Pomógł: 0
Dołączył: 6.02.2005

Ostrzeżenie: (0%)
-----


co racja to racja (IMG:http://forum.php.pl/style_emoticons/default/guitar.gif)
tak to wyglada:

$number=sprintf("%02d",$number);
print $number;

%02d 1 zero - 01, 11
%03d 2 zera - 001, 011

thx :roll2:
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 23:22