Correct way to submit a PHP code

I am trying to get acquainted with the procedures here and hence tried to submit the solution for a practice problem. But, it always returns as wrong answer. I also tried to submit an already selected answer (written in PAS fpc) as my answer (written in PHP), but it still didn’t work. Any insight ? Is my conversion not proper or there is some other way to submit a PHP code ?

My submission:

$stdin = fopen("php://stdin", "r");
$input = fgets($stdin);
$a = explode(' ',$input);
if($a[1]>=($a[0]+0.5) && ($a[0]%5)==0)
  echo number_format((float)($a[1]-$a[0]-0.5),2,'.',''); 
else 
  echo number_format((float)$a[1], 2, '.', '')."\n";
fclose($stdin);

The answer that I copied from: http://www.codechef.com/viewsolution/357216

Found a similar question at http://discuss.codechef.com/questions/1465/atm-solution-in-php. Atempting to use STDIN instead of reading stream.

//