|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-17 15:41 UTC] tony2001@php.net
[2004-08-17 15:41 UTC] tony2001@php.net
[2004-08-17 16:09 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jul 12 05:00:02 2026 UTC |
Description: ------------ When a use the join() function on an array that have a float value, the string returned contains the values formatted without the setlocale() settings Reproduce code: --------------- setlocale(LC_ALL,'pt_BR'); $x="10,01"; $a[1] = $x; $a[2] = floatval(str_replace(",",".",$x)); $a[3] = floatval('10.01'); echo '<pre>'; print_r($a); echo '</pre>'; $b = join("<br>",$a); echo ($b); Expected result: ---------------- Array ( [1] => 10,01 [2] => 10,01 [3] => 10,01 ) 10,01 10,01 10,01 Actual result: -------------- Array ( [1] => 10,01 [2] => 10,01 [3] => 10,01 ) 10,01 10.01 10.01