note 7562 modified in max by ronabop

From: Date: Wed, 13 Sep 2000 16:23:14 +0000
Subject: note 7562 modified in max by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-4828@lists.php.net to get a copy of this message
Fetching values from a mysql database returns strings, whether a field is numeric or not. When sending the fetched values to max() they will be compared as if they were strings: max ('2','8','50') is 8. To compare numbers, cast the values to integer: max((int)'2', (int)'8', (int)'50). http://www.php.net/manual/function.max.php

« previous php.notes (#4828) next »