Using Variables in Simplexml
Posted: Fri Jan 22, 2010 7:09 am
Hi,
I want to be able to use a variable in simplexml statement like this:
$thename = $_GET['NAME'];
$xml = simplexml_load_file("countries.xml");
$thename = $xml->$country->name;
however, it does not allow me to use the variable ($country) this way. Is there a way to do this?
I need to be able to select which country I am working with based on the user's selection.
Thanks,
Mike
I want to be able to use a variable in simplexml statement like this:
$thename = $_GET['NAME'];
$xml = simplexml_load_file("countries.xml");
$thename = $xml->$country->name;
however, it does not allow me to use the variable ($country) this way. Is there a way to do this?
I need to be able to select which country I am working with based on the user's selection.
Thanks,
Mike