From: <var...@us...> - 2011-05-04 10:20:52
|
Revision: 8061 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8061&view=rev Author: vargenau Date: 2011-05-04 10:20:46 +0000 (Wed, 04 May 2011) Log Message: ----------- New utility function: is_whole_number Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2011-04-27 13:53:27 UTC (rev 8060) +++ trunk/lib/stdlib.php 2011-05-04 10:20:46 UTC (rev 8061) @@ -97,6 +97,7 @@ is_localhost($url) javascript_quote_string($s) isSerialized($s) + is_whole_number($var) parse_attributes($line) is_image ($filename) is_video ($filename) @@ -2383,6 +2384,14 @@ } /** + * Determine if a variable represents a whole number + */ + +function is_whole_number($var) { + return (is_numeric($var) && (intval($var)==floatval($var))); +} + +/** * Take a string and return an array of pairs (attribute name, attribute value) * * We allow attributes with or without double quotes (") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |