[Solved] PHP: Echoing XML code- variable in the tag

[ad_1]

Define a variable and use it in the echo like:

echo '<Say voice= "'.$voice.'" language="fr">stuff</Say>'; 

Give $voice whatever value you want.

Also, escape the inner quotes if you need any!

echo '<Say voice= "'.$gender.'" language="fr">\'\'</Say>';

[ad_2]

solved PHP: Echoing XML code- variable in the tag