note 27971 added to ref.array
| From: | mno11 at lycos dot NOSPAM | Date: | Fri, 27 Dec 2002 21:41:09 +0000 |
| Subject: | note 27971 added to ref.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41366@lists.php.net to get a copy of this message | ||
For those that would like something similar to print_r, but instead returns the values as a string,
I've written the following simple function. It doesn't work for 3D arrays, yet...
function arrayData($array)
{
$keys = array_keys($array);
$values = array_values($array);
$data = "";
for ($i=0; $i<count($keys); $i++)
{
$data .= $keys[$i]."=>'".$values[$i]."' , ";
}
return $data;
}
To email me, replace NOSPAM with com
--
http://www.php.net/manual/en/ref.array.php
http://master.php.net/manage/user-notes.php?action=edit+27971
http://master.php.net/manage/user-notes.php?action=delete+27971
http://master.php.net/manage/user-notes.php?action=reject+27971