print the name of a variable

From: Date: Tue, 15 Aug 2000 09:32:01 +0000
Subject: print the name of a variable
Groups: php.general 
Request: Send a blank email to php-general+get-11766@lists.php.net to get a copy of this message
Hello all, How can i print the name of a variable? I mean, when you have $name i want to add "name" to $body. Here's an example. $new_line = "\n<br>"; $fields = array($name, $contact, $function, $adress); $n = count($fields); for ($i = 0; $i < $n; $i++) { if ($fields[$i]) { // this is were i want to add the name of the variable to $body $body = $body."NAME_OF_VARIABLE"; $body = $body.$fields[$i]; $body = $body.$new_line; } } anyone knows how to solve this problem? thanks Bas

« previous php.general (#11766) next »