PHP 8.5.0 Alpha 2 available for testing

Voting

: min(one, seven)?
(Example: nine)

The Note You're Voting On

Jim Granger <tenor at jimgranger.com>
20 years ago
Another way of ignoring the last null entry would be to subtract one from the iteration count like this:

for($i = 0; $i < count($result_array) - 1; $i++)
{
...
}

Helmut's method is far more elegant on its own but what I do is combine the above with the null test that he suggested. It may seem like overkill, but better safe than sorry.

<< Back to user notes page

To Top