Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Closed TopicStart new topic
> [php] przerwanie petli for
-gosciak-
post 28.07.2006, 13:23:03
Post #1





Goście







gdy mam for ($ch=0; $ch<20; $ch++)
ale gdy przed 20 petla zostanie spelniony jakis warunek czy mozna ja przerwac ?
np.przy 5 petli
Go to the top of the page
+Quote Post
nospor
post 28.07.2006, 13:24:48
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




manual, manual i jeszcze raz manual:
http://pl.php.net/manual/pl/control-structures.php
i sobie przejrzyj, a nóż coś znajdziesz smile.gif


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
Cysiaczek
post 28.07.2006, 13:25:47
Post #3





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




  1. <?php
  2. for ($ch=0; $ch<20; $ch++){
  3. if ($ch==5) {break;}
  4. }
  5. ?>


--------------------
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
-gosciak-
post 29.07.2006, 11:50:49
Post #4





Goście







a gdy dam if i wartosc bedzie negatywana, zeby for jeszcze raz powtorzylo petle ?
Go to the top of the page
+Quote Post
Cysiaczek
post 29.07.2006, 11:55:30
Post #5





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




Na to pytanie możesz sobie sam odpowiedzieć, ewentualnie możesz skorzystac z rady @nospora i podejrzeć manual.
Więcej samodzielności prosze. rolleyes.gif


--------------------
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
-Gość-
post 29.07.2006, 13:21:19
Post #6





Goście







pod jakim haslem szukac
bo w sumie nie mam obycia z php i manualem probuje tylko przerobic gotowy skrypt
Go to the top of the page
+Quote Post
nasty
post 29.07.2006, 13:24:09
Post #7





Grupa: Zarejestrowani
Postów: 634
Pomógł: 14
Dołączył: 27.05.2006
Skąd: Berlin

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


Cytat
pod jakim haslem szukac
bo w sumie nie mam obycia z php i manualem probuje tylko przerobic gotowy skrypt


Control Structures

winksmiley.jpg
Go to the top of the page
+Quote Post
Lonas
post 29.07.2006, 15:08:25
Post #8





Grupa: Zarejestrowani
Postów: 576
Pomógł: 14
Dołączył: 9.11.2005

Ostrzeżenie: (20%)
X----


Powiem więcej.. - może tutaj coś jest ?

http://pl.php.net/manual/pl/control-structures.do.while.php


--------------------
Go to the top of the page
+Quote Post

Closed 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: 8.07.2025 - 04:28