![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 19.04.2007 Ostrzeżenie: (0%) ![]() ![]() |
Mam drobny problem...
Jak zrobic, aby else nie odwolywalo sie do do konkretnego if, a stanowilo wyjatek kiedy zadne if nie jest spelnione? Z gory dzieki Pozdrawiam |
|
|
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 4 340 Pomógł: 542 Dołączył: 15.01.2006 Skąd: Olsztyn/Warszawa Ostrzeżenie: (0%) ![]() ![]() |
mozesz np cos takiego machnac
*takie na szybko rozwiazanie -------------------- I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy. QueryBuilder, Mootools.net, bbcradio1::MistaJam http://www.phpbench.com/ |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 19.04.2007 Ostrzeżenie: (0%) ![]() ![]() |
Ale i tak za kazdym razem uzywa sie else...
|
|
|
![]()
Post
#4
|
|
![]() Grupa: Moderatorzy Postów: 4 465 Pomógł: 137 Dołączył: 26.03.2004 Skąd: Gorzów Wlkp. ![]() |
Użyj innej konstrukcji
[php] if(){} elseif(){} elseif(){} else{} [php] Najlepiej jednak użyj instrukcji switch" title="Zobacz w manualu PHP" target="_manual -------------------- 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. |
|
|
![]()
Post
#5
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 19.04.2007 Ostrzeżenie: (0%) ![]() ![]() |
Ok, dzieki Cysiaczek
![]() |
|
|
![]()
Post
#6
|
|
![]() Grupa: Zarejestrowani Postów: 4 340 Pomógł: 542 Dołączył: 15.01.2006 Skąd: Olsztyn/Warszawa Ostrzeżenie: (0%) ![]() ![]() |
Ale i tak za kazdym razem uzywa sie else... yyy no racja moj blad -------------------- I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy. QueryBuilder, Mootools.net, bbcradio1::MistaJam http://www.phpbench.com/ |
|
|
![]()
Post
#7
|
|
![]() Grupa: Moderatorzy Postów: 4 465 Pomógł: 137 Dołączył: 26.03.2004 Skąd: Gorzów Wlkp. ![]() |
Bo to właśnie switch jest stworzony dla wielu warunków - nie trzeba bez przerwy pisać ifelse(){} - jest przekrzyściej.
Pozdrawiam. -------------------- 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. |
|
|
![]()
Post
#8
|
|
Grupa: Zarejestrowani Postów: 19 Pomógł: 0 Dołączył: 19.04.2007 Ostrzeżenie: (0%) ![]() ![]() |
|
|
|
![]()
Post
#9
|
|
![]() Grupa: Zarejestrowani Postów: 1 033 Pomógł: 125 Dołączył: 17.09.2005 Skąd: Żywiec Ostrzeżenie: (0%) ![]() ![]() |
Wyrzucić ją przed switcha:
-------------------- "Sumienie mam czyste, bo nieużywane."
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 21.08.2025 - 21:41 |