PHP remove last zero from integer by substr -
in php values database integer, want remove last 0 20000000
integer, me below code doesnt work.
$payerd_amount = 20000000; $payerd_amount = substr((string)$payerd_amount,1,strlen((string)$payerd_amount) -1);
how action? code seems correct after substring result:
000
if want remove last zero, divide 10
$payerd_amount = $payerd_amount / 10;
this works, too:
$payerd_amount = substr($payerd_amount, 0, -1);
Comments
Post a Comment