Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- pass variable to xpath?
February 1, 2005, 10:23 pm
rate this thread
$fquote would be derived from a form. Any help may save what is left of my
$s = simplexml_load_file('fishquotes.xml');
$fquote = "245";
$findquote = $s->xpath('/fishingquotes/quote[qtnum="260"]');
<fishingquotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance ">
<copy>Govern a family as you would</copy>
<copy> cook a small fish; </copy>
<author> Chinese Proverb</author>
<!--and 450 more quotes-->
Re: pass variable to xpath?
Looks like you are asking a very basic string question. Time to RTFM?
Hard to tell since you didn't ask a specific question. What is supposted
to happen with $fquote? Should it be used instead of the hardcoded 260
See the difference between single quoted strings and double quoted:
So maybe you are looking for:
In that case $fquote has to be "XML escaped" (see htmlspecialchars()).
- » Trouble with join query's, query just dosent produce results
- — Previous thread in » PHP Scripting Forum