Xpath arguments in variable
| From: | Sridhar Pandurangiah | Date: | Wed, 15 Sep 2010 07:36:56 +0000 |
| Subject: | Xpath arguments in variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-308084@lists.php.net to get a copy of this message | ||
Hi
I have the following statement that locates the node "membernumber" with the value A192. This works perfectly fine.
$v = $row->xpath('//membernumber[. = "A192"]');
But now I need to pass this value to XPath within a string variable say
$v = $row->xpath('//membernumber[. = $MemberId]');
But this doesnt work due to the quotes. What I intend PHP to do is to substitute the value for $MemberId and then execute the XPath query. I have grappled with it for a few days before posting this. Any ideas are most welcome
Best regards
Sridhar