PHP: extract values from array of multiple stdclass objects using loop
<pre><code>        `array(2) {
  ["result"]=&gt;
  object(stdClass)#6 (2) {
    ["totalResults"]=&gt;
    int(10514658)
    ["products"]=&gt;
    array(20) {
      [0]=&gt;
      object(stdClass)#7 (13) {
        ["lotNum"]=&gt;
        int(1)
        ["packageType"]=&gt;
        string(5) "piece"
        ["imageUrl"]=&gt;
        string(141) "http://g01.a.alicdn.com/kf/HTB1v_x3LpXXXXbDXFXXq6xXFXXXs/Medium-Super-color-Lace-up-Zapato-Mujer-grid-print-font-b-Shoes-b-font-The-Trend.jpg"
        ["30daysCommission"]=&gt;
        string(8) "US $0.02"
        ["productId"]=&gt;
        float(32515275585)
        ["discount"]=&gt;
        string(2) "0%"
        ["originalPrice"]=&gt;
        string(9) "US $41.99"
        ["productUrl"]=&gt;
        string(48) "http://www.aliexpress.com/item//32515275585.html"
        ["productTitle"]=&gt;
        string(128) "Medium, Super color Lace-up Zapato Mujer grid print Shoes The Trend of Female Soft Leisure Sapatos chaussure femme winter basket"
        ["validTime"]=&gt;
        string(10) "2016-04-15"
        ["volume"]=&gt;
        string(1) "1"
        ["evaluateScore"]=&gt;
        string(3) "5.0"
        ["salePrice"]=&gt;
        string(9) "US $41.99"
      }
      [1]=&gt;
      object(stdClass)#8 (13) {
        ["lotNum"]=&gt;
        int(1)
        ["packageType"]=&gt;
        string(5) "piece"
        ["imageUrl"]=&gt;
        string(134) "http://g02.a.alicdn.com/kf/HTB1Llk.IpXXXXasXpXXq6xXFXXXH/All-match-Women-font-b-shoes-b-font-high-canvas-font-b-shoes-b-font-women.jpg"
        ["30daysCommission"]=&gt;
        string(8) "US $0.39"
        ["productId"]=&gt;
        int(944204198)
        ["discount"]=&gt;
        string(2) "0%"
        ["originalPrice"]=&gt;
        string(9) "US $32.40"
        ["productUrl"]=&gt;
        string(46) "http://www.aliexpress.com/item//944204198.html"
        ["productTitle"]=&gt;
        string(118) "Hot selling! lady high canvas shoes summer &amp; winter casual shoes sneakers for women Color block decoration top quality"
        ["validTime"]=&gt;
        string(10) "2016-04-25"
        ["volume"]=&gt;
        string(2) "18"
        ["evaluateScore"]=&gt;
        string(3) "4.9"
        ["salePrice"]=&gt;
        string(9) "US $32.40"
      }
      [2]=&gt;
      object(stdClass)#9 (13) {
        ["lotNum"]=&gt;
        int(1)
        ["packageType"]=&gt;
        string(5) "piece"
        ["imageUrl"]=&gt;
        string(144) "http://g03.a.alicdn.com/kf/HTB1N..tKXXXXXc3XXXXq6xXFXXXV/Slimming-font-b-shoes-b-font-women-fashion-leather-casual-font-b-shoes-b-font-women.jpg"
        ["30daysCommission"]=&gt;
        string(8) "US $1.14"
        ["productId"]=&gt;
        float(32426274938)
        ["discount"]=&gt;
        string(2) "0%"
        ["originalPrice"]=&gt;
        string(9) "US $27.04"
        ["productUrl"]=&gt;
        string(48) "http://www.aliexpress.com/item//32426274938.html"
        ["productTitle"]=&gt;
        string(101) "Free Shipping!Slimming sneakers for women, lady's Fitness Shoes Trendy Health Lady Beauty Swing Shoes"
        ["validTime"]=&gt;
        string(10) "2016-04-11"
        ["volume"]=&gt;
        string(2) "55"
        ["evaluateScore"]=&gt;
        string(3) "4.8"
        ["salePrice"]=&gt;
        string(9) "US $27.04"
      }
      [3]=&gt;
      object(stdClass)#10 (13) {
        ["lotNum"]=&gt;
        int(1)
        ["packageType"]=&gt;
        string(5) "piece"
        ["imageUrl"]=&gt;
        string(160) "http://g02.a.alicdn.com/kf/HTB1t5a9KFXXXXcdXXXXq6xXFXXXN/Hot-Fashion-Women-Genuine-Leather-font-b-Shoes-b-font-Height-Increasing-Platform-Wedge-Sneakers-Low.jpg"
        ["30daysCommission"]=&gt;
        string(8) "US $0.06"
        ["productId"]=&gt;
        int(1717026606)
        ["discount"]=&gt;
        string(2) "0%"
        ["originalPrice"]=&gt;
        string(9) "US $49.58"
        ["productUrl"]=&gt;
        string(47) "http://www.aliexpress.com/item//1717026606.html"
        ["productTitle"]=&gt;
        string(123) "2014 Summer Cutout Shoes Velcro Elevator Color Block Decoration Sneaker Shoes Sport Shoes Casual High-Top Women's Cool Boot"
        ["validTime"]=&gt;
        string(10) "2016-04-01"
        ["volume"]=&gt;
        string(1) "2"
        ["evaluateScore"]=&gt;
        string(3) "5.0"
        ["salePrice"]=&gt;
        string(9) "US $49.58"
      }

    }
  }
  ["errorCode"]=&gt;
  int(20010000)
}`
</code></pre>

<blockquote>
  <p>this is the responce im getting i want to get the values in the base of keys using an loop for each 4 objects i tried many solution posted here but no one is working.. </p>
</blockquote>

<p>need help please reply!
thanks in advance</p>