note 48563 deleted from function.array by nlopess
| From: | nlopess@php.net | Date: | Wed, 29 Dec 2004 21:28:50 +0000 |
| Subject: | note 48563 deleted from function.array by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-82470@lists.php.net to get a copy of this message | ||
Note Submitter: eduardo at minicom dot com dot br
----
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;
}
?>