3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. $arr=array();
    if(sizeof($arr)%2==0)
    {
    echo $arr[(sizeof($arr)/2)-1];
    echo $arr[(sizeof($arr)/2)];
    }
    else
    echo $arr[(sizeof($arr)+1)/2];

    ReplyDelete
  3. $str=$_POST['num'];
    $y=explode(",",$str);
    $n=sizeof($y);
    $m_array=array();
    for($i=0;$i<=$n-1;$i++)
    {
    for($j=$i+1;$j<=$n-1;$j++)
    {
    if($y[$i]>$y[$j])
    {
    $temp=$y[$i];
    $y[$i]=$y[$j];
    $y[$j]=$temp;
    }

    }

    }
    for($i=0;$i<$n;++$i)
    {
    if($y[$i]!=$y[$i+1])
    {
    $m_array[$i]=$y[$i];
    }
    }
    print_r($m_array);

    ReplyDelete