I have a XML file that I would like to parameterize with php variable. This file is call with simplexml_load_string
in a php script. I know It's possible to use php inside xml file in "classic use", but I didn't find any example with simple_xml_load_string
call.
XML example, suppose MY_PHP_VARIABLE
is what I want to integrate in the xml:
<navigator title="my title">
<presentation>
<request>
<wpss>
<wps name="test" url="MY_PHP_VARIABLE">
...
I try all possible combinaisons of: with/without php tag, with/without single quote, with/without double quote for :
- echo MY_PHP_VARIABLE;
- <![CDATA[<?php echo MY_PHP_VARIABLE; ?>]]>
I'm not the owner of the xml reader code, so if it's possible to find a solution to integrate the xml file only, it will be perfect for me. If not I will try to deal with it.
Thanks