Sunday, November 15, 2009
string to attribute name in PHP classs
Posted on 4:26 PM by programlover
Hi
This works fine:
php Code:
echo $xml -> value;
but this doesn't:
php Code:
$v = "value";
echo $xml -> $v;
I'd get this error:
Notice: Array to string conversion in...
How can I change that string so php interprets it to an attribute name?
mnaghdi
View Public Profile
Send a private message to mnaghdi
Find all posts by mnaghdi
#2
Today, 7:24 am
JAY6390
Hand of A'dal
Recent Blog: How to reset your wordpress administrator password
Join Date: Aug 2008
Location: UK
Posts: 484
echo $xml->{$value};
try that