title: Write PHP array object to a csv file
body: <p>I would like to ask that how can I write a php array std object to a csv file.</p>
  <p><a href="https://stackoverflow.com/questions/3933668/convert-array-into-csv">Convert array to csv</a> Didn't solve my problem.</p>
  <p>This is my Array</p>
  <pre><code>Array
      (
          [0] =&gt; stdClass Object
              (
                  [lotNum] =&gt; 1
                  [commissionRate] =&gt; 4.0%
                  [detailUrl] =&gt; JEq7E6IEa
                  [promotionVolume] =&gt; 0
                  [packageType] =&gt; piece
                  [price] =&gt; US $80.54
                  [imageUrl] =&gt; BOX.jpg
                  [subject] =&gt; Box
                  [salePrice] =&gt; US $60.41
                  [commission] =&gt; US $0.00
                  [productId] =&gt; xxxx1
              )
  
          [1] =&gt; stdClass Object
              (
                  [lotNum] =&gt; 1
                  [commissionRate] =&gt; 4.0%
                  [detailUrl] =&gt; JEq7E6IEa
                  [promotionVolume] =&gt; 0
                  [packageType] =&gt; piece
                  [price] =&gt; US $80.54
                  [imageUrl] =&gt; BOX.jpg
                  [subject] =&gt; Box
                  [salePrice] =&gt; US $60.41
                  [commission] =&gt; US $0.00
                  [productId] =&gt; xxxx1
              )
      )
  </code></pre>
  <p>How can I put data of each product in one row of csv file?
  Thanks :)</p>