title: How Do I Add an Attribute to an Array for a SoapClient Request In PHP
body: <p>Hi Im quite new to using Soap, but all is going quite well, I have written a script using PHP soap-client, and all is well apart from one tag which has an attribute, and i can figure out a way to pass this in the $params list before the call to the service.</p>
  
  <p>Im building the params like so:- (excert)</p>
  
  <pre><code>'Goods' =&gt; array(
        'Description' =&gt; '$Description','Quantity' =&gt; '$qty');
  </code></pre>
  
  <p>however I need the XML to be:-</p>
  
  <pre><code>&lt;Goods Type="EGoods"&gt;              
             &lt;Description&gt;Test&lt;/Description&gt;
             &lt;Quantity&gt;1&lt;/Quantity&gt;
  &lt;/Goods&gt;
  </code></pre>
  
  <p>Note the type="EGoods" on the goods tag, how can i modify my array in php to account for this attribute?</p>
  
  <p>When I submit the soap request as is, I get the error saying goods cant be null or empty.</p>
  
  <p>Thanks For any help.</p>