Searching through a list of numbers which came from mysql query result
<pre><code>$save_planet3 = "SELECT saver_id FROM save_planet 
                WHERE saver_id = '".($_SESSION['user_id'])."' 
                AND map = 1 ORDER BY time_saved DESC";
$save_planet2 = mysql_query($save_planet3) or trigger_error("SQL", E_USER_ERROR);   

while ($list = mysql_fetch_array($save_planet2)) { 
  $saver_id = $list['saver_id']; 
</code></pre>

<p>When I <code>echo $saver_id</code> I'm getting a list of numbers</p>

<p>3112   3112   3112   3112<br>
I'm trying to do a check if <code>$planet_id</code> is equal to any of these numbers</p>

<p>So I figure the only way to do this is to put these numbers in an array with keys first. So I tried to explode it but it doesn't give each one a different key I noticed. </p>

<pre><code>$check = explode(",", $saver_id);
print_r($check); 


Array ( [0] =&gt; 3112 )
Array ( [0] =&gt; 3112 )
Array ( [0] =&gt; 3112 )
Array ( [0] =&gt; 3112 )
</code></pre>

<p>Once I get this in a workable array I should be able to do this right</p>

<pre><code>foreach($array as $key =&gt; $value) {    
  if ($planet_id == $value) { 
  //something happends
</code></pre>
