title: Echoing PHP Variable inside XML
body: <p>I'm collecting form information and I have to post that data to a URL in XML format.  So I'm putting the XML into a post string and using cURL to execute the post.  How would I echo the proper form fields into the XML?  In the ProjectId I put what I thought would be the code, but Notepad++ isn't showing it as being valid PHP so I think that's wrong.  Thanks!</p>
  
  <pre><code>$post_string = '
  
  &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  
  &lt;Ping vid="" sid=""&gt;                   
     &lt;ProjectInfo&gt;
        &lt;ProjectId&gt;&lt;? echo $projectid; ?&gt;&lt;/ProjectId&gt;
        &lt;SubProject&gt;&lt;/SubProject&gt;
     &lt;/ProjectInfo&gt;
   &lt;/Ping&gt;
  
  
   ';
  </code></pre>
  
  <p>I was using this link to figure it out: <a href="http://www.codediesel.com/php/posting-xml-from-php/" rel="nofollow">http://www.codediesel.com/php/posting-xml-from-php/</a></p>