I trying to sort an array ising php but this code is not working. can any body tell me whats wrong with this code, is my logic is right or wrong. I don't know much about Php as I am new to learning php
<? php
$a= array(12,5,78,10,63,11);
$size=$sizeof($a);
for($i=0;$i<=$size;$i++)
{
for($j=$i+1;$j<$a[$i];$j++)
{
if($a[$i]>$j)
{
$temp=$a[i];
$a[$i]=$j;
$j=$temp;
}
}
}
for($i=0;$i<=$size;$i++)
{
echo $a[$i];
echo"<br/>"
}
?>