Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php float number error

I am trying to assign float value in php to variable I tried following,

$_web_lat=‎18.501059;
$_web_long=73.862686;

echo $_web_lat .'='. $_web_long;

[Parse error: syntax error, unexpected '.501059' (T_DNUMBER)]

OR

$_web_lat=floatval('‎18.501059');
$_web_long=floatval('‎‎73.862686');

echo $_web_lat .'='. $_web_long;

Both shows 0 as output? Anyone guide me on this?

like image 276
SK IRT Avatar asked Jun 04 '26 21:06

SK IRT


1 Answers

Your code seems to have a hidden character ?

Try copy and use this:

<?php
$_web_lat=18.501059;
$_web_long=73.862686;

echo $_web_lat .'='. $_web_long;

?>
like image 135
Karlo Kokkak Avatar answered Jun 07 '26 10:06

Karlo Kokkak