Jump to content

passing value into xml parser


batearedfox

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.