How get the name of the array variable?
| From: | Tomek Golembiewski | Date: | Fri, 15 Feb 2002 08:16:43 +0000 |
| Subject: | How get the name of the array variable? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-84870@lists.php.net to get a copy of this message | ||
I got the problem , I want make preety debug function that shows array keys
and values and name of the variable containing array:
Here it is:
function show_arr($array)
//wyswietla wartosci z tablicy wraz z kluczami (przeznaczone do debugowania)
{
if(DABUG)
{
echo "<b>-------------------------------------------</b><br>";
echo "Array contents<b>".strval($array)."</b><br>";
while(list($k,$v)=each($array))
{
echo "$k = $v<br>";
}
echo "<b>-------------------------------------------</b>";
}
}
unfortunatly strval want work with arrays...
Any possible solution how to get name of the array variable?