On Wed, 2010-09-15 at 13:06 +0530, Sridhar Pandurangiah wrote:
> 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
>
Use double quotes instead, which should allow PHP to expand the
variables.
Thanks,
Ash
http://www.ashleysheridan.co.uk