note 123528 added to function.max
| From: | info at osworx dot net | Date: | Fri, 18 Jan 2019 10:37:01 +0000 |
| Subject: | note 123528 added to function.max | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-210074@lists.php.net to get a copy of this message | ||
Be aware if a array like this is used (e.g. values from a shopping cart):
<?php
Array
(
[0] => 142,80
[1] => 39,27
[2] => 22,80
[3] => 175,80
)?>
The result will be: 39,27 and not - as expected - 175,80
So, to find the max value, use integer only like:
<?php
Array
(
[0] => 14280
[1] => 3927
[2] => 2280
[3] => 17580
)?>
and you will get the correct result: 17580
----
Server IP: 91.118.111.7
Probable Submitter: 194.96.61.246
----
Manual Page -- http://php.net/manual/en/function.max.php
Edit -- https://master.php.net/note/edit/123528
Del: integrated -- https://master.php.net/note/delete/123528/integrated
Del: useless -- https://master.php.net/note/delete/123528/useless
Del: bad code -- https://master.php.net/note/delete/123528/bad+code
Del: spam -- https://master.php.net/note/delete/123528/spam
Del: non-english -- https://master.php.net/note/delete/123528/non-english
Del: in docs -- https://master.php.net/note/delete/123528/in+docs
Del: other reasons-- https://master.php.net/note/delete/123528
Reject -- https://master.php.net/note/reject/123528
Search -- https://master.php.net/manage/user-notes.php