[phpXML] Re: [phpXML] Re: Searching on attributes
Brought to you by:
bs_php,
nigelswinson
From: <inf...@aj...> - 2001-10-08 15:44:47
|
Bonjour luc, Le samedi 7 juillet 2001 à 09:10:32, vous écriviez : lsec> '//agenda/month[@name="$month_name"]'); It's not phpXml but an error with your PHP coding : Between single quotes PHP doesn't calculate/evaluate the variables if you make this test : $month_name = 18; echo '//agenda/month[@name="$month_name"]'; You will obtain this output : //agenda/month[@name="$month_name"] To correct you must write : echo "//agenda/month[@name=\"$month_name\"]"; and you will have : //agenda/month[@name="18"] I prefer this : echo sprintf( '//agenda/month[@name="%s"]', $month_name) ; I use echo to demonstrate, you use this in strings.. (Sorry but my english is poor, I hope I help you) -- Cordialement, Daniel mailto:inf...@aj... ---------- Support-Assistance PHP/MySql de «Internet Pour Tous» http://www.i-p-t.com.fr/ :::XML/XSLT - Sablotron::: -- -- This message has been sent through the <phpXML/> user discussion list. To unsubscribe, please visit https://sslsites.de/mailinglisten/user/us...@li.../ |