Is There a More Efficient Way to Write Nested While Loops?
- by Ryan
The code below shows nested while loops, but it's not the very efficient. Suppose I wanted to extend the code to include 100 nested while loops. Is there a better way to accomplish this task?
<?php
$count = 1;
$num = 1;
$options=3;
while ( $num <=$options )
{
echo "(".$num . ") ";
$num1 = 1;
$options1=3;
while (…