L
L
Leopandro2016-02-21 17:56:56
Yii
Leopandro, 2016-02-21 17:56:56

What is the replacement for for if you need the exact number of repetitions?

to not write
for ($i = 0; $i < 4; $i++)
{
}( and then think the expression inside will be executed 3 times or 4
isn't it easier to do
justDoIt(3)(do 3 times???)
{
}
no similar function in php?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2016-02-21
@sergiks

$n = 3;
while( $n--) { /* do it here */ }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question