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


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>';

solved PHP: Echoing XML code- variable in the tag