title: array_walk returns true or false. Need to return a variable instead
body: <p>Badly stuck here : I have to compare first two values of the string and return the third part of the string.
  eg if(80 &lt; 88 &amp;&amp; 88 &lt; 96) return 1000. Currently since i am using array_walk i am just getting true or false.   Any other work around for this apart from doing multiple foreach ?</p>
  
  <pre><code> $fortuneArray = ['1'=&gt; '80 | 96 | 1000','2'=&gt;'3648|4000|100'];
  $valueToBeCompared = ['88'];
  
  $val =array_walk($fortuneArray,'test_print',$valueToBeCompared);
  
  function test_print($fortuneArray,$valueToBeCompared)
  {
     $compare = explode('|',$fortuneArray);
  
     if($compare[0] &lt; $valueToBeCompared &amp;&amp; $compare[1] &gt; $valueToBeCompared){
  
                return  $compare[2];
              }
          }
  </code></pre>