I'll do an easier example:
<?php //We'll call this file example.php //This is what a PHP variable looks like $myVariable = "This is a PHP variable" //Echo: Output a string or a number onto the page //We use the backslash before the doublequote since the echo statement already uses double quotes. Alternatively you could use single quotes, with no backslashes, but I prefer to do it this way incase of problems (which I've had) echo "<?xml version=\"1.0\" encode=\"UTF-8\"?>"; echo "<firstChild>"; //We add a variable to the string like we do in Flash. We close the string, add a dot (instead of a plus), write the variable, add another dot, and open the string again echo "<childNode attribute=\"".$myVariable."\" />"; echo "</firstChild>"; ?>
So now if you went into Flash...
var myXML:XML = new XML(); myXML.ignoreWhite = true; myXML.onLoad = function(success:Boolean) { if(success) { trace(this.firstChild.childNodes[0].attributes["attribute"]); } } myXML.onLoad("example.php");