note 91290 added to function.strlen
| From: | raphaeldumonte at yahoo dot com | Date: | Thu, 04 Jun 2009 03:30:56 +0000 |
| Subject: | note 91290 added to function.strlen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156343@lists.php.net to get a copy of this message | ||
Here is a function (int__) that will allow you to change an integer (e.g. 10000) into a comma-ized
format. lol. (e.g. 10,000)
Works fine with me... If someone can clarify what i was able to do, I'd be very happy.
function reverse_string($str){
$a = strlen($str);
str_split($str);
for ($b = $a; $b >= 0; $b--){
$return = $return.$str[$b];
}
return $return;
}
function int__($i){
$a = strlen($i);
$i = reverse_string($i);
str_split($i);
for ($b = $a; $b > 0; $b--){
$c = $b % 3;
if ($c == 0 && $b != ($a) && $b != ($a - 1))$val = $val.",";
$val = $val.$i[$b];
}
//$val = reverse_string($val);
return $val;
----
Server IP: 69.147.83.197
Probable Submitter: 210.213.222.246
----
Manual Page -- http://www.php.net/manual/en/function.strlen.php
Edit -- https://master.php.net/note/edit/91290
Del: integrated -- https://master.php.net/note/delete/91290/integrated
Del: useless -- https://master.php.net/note/delete/91290/useless
Del: bad code -- https://master.php.net/note/delete/91290/bad+code
Del: spam -- https://master.php.net/note/delete/91290/spam
Del: non-english -- https://master.php.net/note/delete/91290/non-english
Del: in docs -- https://master.php.net/note/delete/91290/in+docs
Del: other reasons-- https://master.php.net/note/delete/91290
Reject -- https://master.php.net/note/reject/91290
Search -- https://master.php.net/manage/user-notes.php