Thanks for your response.
I am getting some errors though.
This is the complete code im using and the errors produced
$auth_array = array($result[29],$result[30],$result[31],$result[32],$result[33],$result[34],$result[35],$result[36],$result[37],$result[38]);
$length = count($auth_array);
$newarray = array();
for($i = 0; $i <= $length; $i++){
if($auth_array[$i] != 0) {
$newarray[] = $auth_array[$i];
}
}
$newlength = count($newarray);
$string ='';
for($i = 0; $i <= $newlength; $i++){
if($i == $newlength) {
$string .= '& '.$newarray[$i];
}
else {
$string .= $newarray[$i].' ';
}
}
echo $string;
which results in the following errors
Notice: Undefined offset: 10 in /default.php on line 167
Notice: Undefined offset: 3 in /default.php on line 177
Line 167 is
if($auth_array[$i] != 0) {
and line 177 is
$string .= '& '.$newarray[$i];
It does output something after the error which is the following
It should display 128, 265 & 225
Thanks for your help