title: Function is not giving desired result
body: <p>I am having a php function:</p>
  
  <pre><code>&lt;?php
  function find_senior($mylevel, $sender){
      global $class_database;
      global $g_level1;
      global $g_level2;
      global $g_level3;
  
  $sponsor=$class_database-&gt;getdata("sponsorid", "id='$sender' AND gift_level &gt; '$mylevel'", "user");
  $sponsor2=$class_database-&gt;getdata("sponsorid", "id='$sender'", "user");
      if(strlen($sponsor) &gt; '0'){
          if($mylevel &lt; $g_level1){
          return array("id"=&gt;"1", "amt"=&gt;$g_level1, "lvl"=&gt;$g_level1);    
          }
          elseif($mylevel &lt; $g_level2){
          return array("id"=&gt;"1", "amt"=&gt;$g_level2, "lvl"=&gt;$g_level2);    
          }
          elseif($mylevel &lt; $g_level3){
          return array("id"=&gt;"1", "amt"=&gt;$g_level3, "lvl"=&gt;$g_level3);    
          }
      }
      elseif(strlen($sponsor) &lt;='0' &amp;&amp; strlen($sponsor2) &lt;='0'){
          if($mylevel &lt; $g_level1){
          return array("id"=&gt;"1", "amt"=&gt;$g_level1, "lvl"=&gt;$g_level1);    
          }
          elseif($mylevel &lt; $g_level2){
          return array("id"=&gt;"1", "amt"=&gt;$g_level2, "lvl"=&gt;$g_level2);    
          }
          elseif($mylevel &lt; $g_level3){
          return array("id"=&gt;"1", "amt"=&gt;$g_level3, "lvl"=&gt;$g_level3);    
          }   
      }
  elseif(strlen($sponsor) &lt;='0' &amp;&amp; strlen($sponsor2) &gt;'0'){
      find_senior($mylevel, $sponsor2);
      }
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>it should return as array when we do var_dump()</p>
  
  <pre><code>$array=show("100", "2");
  var_dump($array);
  </code></pre>
  
  <p>But it is returning only :</p>
  
  <pre><code>NULL
  </code></pre>
  
  <p>Where is the error may be ?
  I am very new to php, please try to solve this puzzle, I tried a lot, but may be for my limited knowledge I am ubnable to solve it</p>