Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php]jak z liczby 6 zrobic 06
--kurak--
post 21.12.2007, 15:55:34
Post #1





Goście







jak z liczby 6 zrobic 06 ? czy jest na to jakas funkcja ?
chcialbym napisac skrypt ktory mi sprawdza czy liczba to 6 czy 06, jazeli 6 to zeby zmienic ja na 06
Go to the top of the page
+Quote Post
Cysiaczek
post 21.12.2007, 16:28:28
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




  1. <?php
  2. $liczba=6;
  3. $liczba=6;
  4. //if($liczba<10)
  5. if(strlen($liczba)==1)
  6. {
  7. $liczba="0".$liczba;
  8. }
  9. ?>


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
--kurak--
post 21.12.2007, 17:09:15
Post #3





Goście







snitch.gif dzieki wielkie, smiga jak trzeba
Go to the top of the page
+Quote Post
webdice
post 21.12.2007, 17:15:04
Post #4


Developer


Grupa: Moderatorzy
Postów: 3 045
Pomógł: 290
Dołączył: 20.01.2007




  1. <?php
  2. $liczba = sprintf("%02d", $liczba);
  3. ?>
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 19.07.2025 - 17:26