<?php
$tot=fgets(STDIN);
$m=fgets(STDIN);
echo bcsub($tot,$m);
?>
inputs:
10
2
output
0
but this
<?php
$tot='10';
$m='2';
echo bcsub($tot,$m);
?>
gives proper output:
8
and in both cases, $tot and $m are strings,
why does this happen and how do i fix it?
created
last reply
- 2
replies
- 616
views
- 2
users