August 14th, 2000, 02:41 AM
-
Can I get the variable name in PHP?
eg. $abc="100";
I want to get the name of variable ($abc), i need to get the string "abc". Can I do it?
August 14th, 2000, 02:52 AM
-
As far as getting the varibale name $abc is concerned i do not think there should be any problem..u can get the string stored in it.
August 14th, 2000, 04:57 AM
-
I dont think the is any way we can get the variable name from the value in PHP. If somebody comes up with real answer please inform me to.
August 14th, 2000, 07:14 AM
-
<<
I want to get the name of variable ($abc), i need to get the string "abc". Can I do it?
>>
yes,but i think you may not get any function support for this.but if you want to get some variable names from form then it is possible using $HTTP_POST_VARS(see the manual for details).
The above variable name you can get very easily..
<?
$test="hello";
echo substr("$test",1);
//returns the variable name.make sure that '' slash is thier before variable.
//it will print 'test'
?>
i don't know wether using some function you can achive samething..
Good Luck!!!
------------------
SR -
webshiju.com
www.jobxyz.com-IT Career Portal
ezipindia.com--WebStudio
"The fear of the LORD is the beginning of knowledge..."
[This message has been edited by Shiju Rajan (edited August 14, 2000).]