note 48563 added to function.array
| From: | eduardo at minicom dot com dot br | Date: | Wed, 29 Dec 2004 18:49:17 +0000 |
| Subject: | note 48563 added to function.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-82465@lists.php.net to get a copy of this message | ||
As my need, I've made a function that scan the assoc. array and format every row that is
numeric, otherwise dont make nothing.
In this example, the function format in Brazillian way, its all about to change it :)
<?php
function numFrmtAssoc($arrNum){
foreach ($arrNum as $key=>$value){
foreach ($value as $keyAssoc=>$valueAssoc){
if(is_numeric($valueAssoc))
$buffArr[] = $value[$keyAssoc] =
number_format($valueAssoc,'2',',','.');
else
$buffArr[] = $value[$keyAssoc] = $valueAssoc;
}
}
return $buffArr;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.array.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48563
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48563&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48563&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48563&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48563&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48563&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48563&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48563&report=yes
Search -- http://master.php.net/manage/user-notes.php