note 71279 deleted from function.substr by nlopess
| From: | nlopess@php.net | Date: | Fri, 26 Jan 2007 16:20:32 +0000 |
| Subject: | note 71279 deleted from function.substr by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122232@lists.php.net to get a copy of this message | ||
Note Submitter: lisandrom_at_cantv_net
----
This small function return a integer in dotted (decimal) notation:
function dotted_int($int) {
$last3 = substr($int, strlen($int) - 3, 3);
if (strlen($int) <= 3) {
return $last3;
} else {
return dotted_int(substr($int, 0, strlen($int) - 3)) . "." . $last3;
}
}
echo dotted_int(123456789);
// prints 123.456.789