note 88625 added to book.math

From: Date: Sun, 01 Feb 2009 14:48:48 +0000
Subject: note 88625 added to book.math
Groups: php.notes 
Request: Send a blank email to php-notes+get-150060@lists.php.net to get a copy of this message
On "23-Dec-2008 07:20", Anonymous gave this function to calculate the number of digits: function digit_count($num){ for($i=0;pow(10,$i)<=$num;$i++){ if(pow(10,$i+1)>$num){ $num_digits = $i+1; } } return $num_digits; } However this is better: function digit_count($num){ return strlen((string)$num); } ---- Server IP: 87.124.35.190 Probable Submitter: 86.128.241.244 ---- Manual Page -- http://www.php.net/manual/en/book.math.php Edit -- https://master.php.net/note/edit/88625 Del: integrated -- https://master.php.net/note/delete/88625/integrated Del: useless -- https://master.php.net/note/delete/88625/useless Del: bad code -- https://master.php.net/note/delete/88625/bad+code Del: spam -- https://master.php.net/note/delete/88625/spam Del: non-english -- https://master.php.net/note/delete/88625/non-english Del: in docs -- https://master.php.net/note/delete/88625/in+docs Del: other reasons-- https://master.php.net/note/delete/88625 Reject -- https://master.php.net/note/reject/88625 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#150060) next »