Hi there i'm having some issue regarding comparison between a 2D array and a variable declared as $thold. when ever i tried to compare only the if or the only else work.The code is..
for($i = 0; $i < $lvalue; $i++){
for($j = 0; $j < $lvalue; $j++){
if($array[$i][$j] > $thold){
$array[$i][$j]=0;
echo $array[$i][$j]." ";
}
else{
$array[$i][$j]=1;
echo $array[$i][$j]." ";
}
}
Try foreach and referenced values (not tested):
foreach($lvalue as $i => &$inner){
foreach($inner as &$val){
if($val > $thold){
$val = 0;
echo $val." ";
}else{
$val = 1;
echo $val." ";
}
}
}