Find numbers in strings with php


function strnums($b)
  {
  $a=' 1234567890.';
  $c=0;
  $n=false;
  for ($x=0;$x<strlen($b);$x++)
    {if (strpos($a,$b[$x])) 
      {if (!$n) {$beg=$x;$n=true;}}
	  else {if ($n) {$num[$c]=substr($b,$beg,$x-$beg);$c++;$n=false;}}}
  return ($num);	  
  }	  


Example:
$q=strnum('120 radio stations boradcast on FM102.10 MHz using 100KW of power');
$q will be an array with
q[0]=120
q[1]=102.10
q[2]=100

See frame