batearedfox Posted May 4, 2010 Share Posted May 4, 2010 Hi, I'm using the xml parser here http://www.criticaldevelopment.net/xml/doc.php (as I only have access to php4 for this) and I'm trying to feed a variable into a function in which I wish to define the project field (see below) echo $parser->document->project1[0]->name[0]->tagData ; I've tried $project = 'project1'; echo $parser->document->$project[0]->name[0]->tagData ; but that dies. Really sorry if this is an obvious syntax error, new to php and I've spent an hour on google to no avail. Thanks for reading Tom Link to comment https://forums.phpfreaks.com/topic/200714-passing-value-into-xml-parser/ Share on other sites More sharing options...
batearedfox Posted May 5, 2010 Author Share Posted May 5, 2010 just needed curly braces around my variable! Link to comment https://forums.phpfreaks.com/topic/200714-passing-value-into-xml-parser/#findComment-1053507 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.