How can I do something like this - loop thru an indefinite set of numbers
<p>I'm trying to loop tru a set of numbers based on the initial number. Tried, but cant see a good way to achieve this. The thing goes inside a while loop.</p>

<pre><code>&lt;?php

$this = 1;

//If 1 then 1,4,7
//If 2 then 3
//If 3 then 10

while ( //mySql while loop ) {
    if ( $this == 1 ) {
        call example() //thrice for 1, 4, 7
    }
}

function example($a) {
    echo $a+10;
}
?&gt;
</code></pre>

<p>Here, based on what <code>$this</code> is, I need to call function example. So if <code>$this = 1</code>, I need to call <code>example</code> thrice - <code>$a</code> value <code>1, 4, 7</code>. If <code>$this = 2</code> I need to call it once, value <code>3</code>.</p>

<p>What would be a good way to achieve this?</p>
