Array iteration issue
<p>I have this array which I echo and get this result:</p>

<pre><code>$hostess_ids=array();
while($row=mysql_fetch_array($resulthst,MYSQL_ASSOC)){
    $hostess_ids[]=$row['hostess_id'];
}
$j=0;

foreach($hostess_ids as $hostess_selected){
    $hostess_array= explode("-",$hostess_selected);
    for ($j=0; $j&lt;count($hostess_array);$j++) {
        $hst1=$hostess_array[$j];
        $sql2="";
    }
}
</code></pre>

<p>This is the output</p>

<pre><code>array(1) { [0]=&gt; string(2) "16" } 
array(1) { [0]=&gt; string(2) "16" } 
array(1) { [0]=&gt; string(0) "" } 
array(1) { [0]=&gt; string(0) "" } 
array(2) { [0]=&gt; string(2) "17" [1]=&gt; string(1) "1" } 
array(1) { [0]=&gt; string(0) "" } 
array(2) { [0]=&gt; string(2) "17" [1]=&gt; string(1) "1" } 
array(2) { [0]=&gt; string(2) "17" [1]=&gt; string(2) "16" }
</code></pre>

<p>The output of hostess_ids[]</p>

<pre><code> array(8) { [0]=&gt; string(2) "16" [1]=&gt; string(2) "16" [2]=&gt; string(0) "" [3]=&gt; string(0) "" [4]=&gt; string(4) "17-1" [5]=&gt; string(0) "" [6]=&gt; string(4) "17-1" [7]=&gt; string(5) "17-16" } 
</code></pre>

<p>How can I iterate in this array to get the first ceel values, then the second one, etc.</p>
