Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] ciąg znaków
agataperz
post 20.08.2011, 10:58:20
Post #1





Grupa: Zarejestrowani
Postów: 181
Pomógł: 0
Dołączył: 24.03.2009
Skąd: Hamburg DE

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


Witam,

mam mały problem - w SQL ma kolumnę ID która posiada kolejne cyfry tj.:
1
2
...
500
...
1000
itd.

chciałabym ażeby php wyświetlił mi te cyfry w formacie 6 cyfrowym czyli:
000001
000002
...
000500
...
001000
itd.


Jak można tego dokonać?
Jest jakaś funkcja?
Go to the top of the page
+Quote Post
Cysiaczek
post 20.08.2011, 11:20:28
Post #2





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




http://pl2.php.net/manual/en/function.str-pad.php

Następnym razem, zanim napiszesz podobny temat, zajrzyj do manuala.


--------------------
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
agataperz
post 20.08.2011, 11:57:51
Post #3





Grupa: Zarejestrowani
Postów: 181
Pomógł: 0
Dołączył: 24.03.2009
Skąd: Hamburg DE

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


dzieki, niestety jakbym znalazla w manualu to bym nie pisala.
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: 25.04.2024 - 11:27