how to define the range of dynamic array within the if loop?
<p>I am working with dynamic arrays and their range depends on the user inputs. I want that if user enters some value, that value is matched with some static data that is also in the array. I want to define the range that if user enters a value that is greater than the static array value then the mean or smaller value will be displayed.</p>

<p>Coding:</p>

<pre><code>&lt;?php
include('config.php');
$sa="select * from table1 where c13='$d'";
$result=mysql_query($sa) or die(mysql_error());
$row_count=0;

while($row = mysql_fetch_array($result)) 
{ 
     $row['c1'];
   $row['c2'];
     $row['c3'];
     $row['c4'];
$a[]=$row['c1'];
        $b[]=$row['c2'];
            $c[]=$row['c3'];
            $d[]=$row['c4'];
$m[]=round(($row['c1']/$row['c4']),2);
                $n[]=round(($row['c2']/$row['c4']),2);
                $o[]=round(($row['c3']/$row['c4']),2);
$m1[]=abs(round(((($row['c1'])*($th)+($row['c1']*$xa)+($row['c5']*$xb)+($row['c9']*$xc))+1),2));

$fa=implode($a,',');
$fa1=explode(',',$fa);
$fb=implode($b,',');
$fb1=explode(',',$fb);
for($i=0;$i&lt;$row_count;$i++) 
{

 $fc=implode($m1,',');
     $rc=explode(',',$fc);

     $fc1=implode($n1,',');
     $rc1=explode(',',$fc1);
    echo "&lt;td&gt;".$rc[$i]. "&lt;/td&gt;";
}
for($i=0;$i&lt;$row_count;$i++) 
{

if($fa1&lt;=$rc)
{
echo "&lt;td&gt;". $fa1[$i]. "&lt;/td&gt;";
}
else
{
echo "&lt;td&gt;". $rc[$i]. "&lt;/td&gt;";
}
if($fe1&lt;=$rc3)
{
echo "&lt;td&gt;". $fe1[$i]. "&lt;/td&gt;";
}
else
{
echo "&lt;td&gt;".$rc3[$i]. "&lt;/td&gt;";
}
if($fi1&lt;=$rc6)
{
echo "&lt;td&gt;". $fi1[$i]. "&lt;/td&gt;";
}
else
{
echo "&lt;td&gt;". $rc6[$i]. "&lt;/td&gt;";
}
 echo "&lt;/tr&gt;";
   echo "&lt;tr&gt;";
</code></pre>

<p><code>$fa</code> is an array and <code>$rc</code> is an array and <code>$fa</code> is an array that contains data from the database and <code>$rc</code> is an array in which value will come after some formulas. I want the value to echo that are less, for example:</p>

<pre><code>$fa[ 2 45 6 ]
$rc[ 5 65 10] // these value come after formulas//
</code></pre>

<p>I want to display like this value <code>[2 3 6]</code>. I want to display the value within the range of 10.</p>
