fork download
  1. <?php
  2. $results = array(
  3. responseHeader=>
  4. status=>0,
  5. QTime=>1,
  6. params=>
  7. wt=>"php",
  8. start=>"0",
  9. q=>"monitor",
  10. version=>"2.2",
  11. rows=>"10"
  12. )
  13. ),
  14. response=>
  15. numFound=>2,
  16. start=>0,
  17. docs=>
  18. 0=>
  19. id=>"VA902B",
  20. name=>"ViewSonic VA902B - flat panel display - TFT - 19\"",
  21. manu=>"ViewSonic Corp.",
  22. weight=>190.4,
  23. price=>279.95,
  24. price_c=>"279.95,USD",
  25. popularity=>6,
  26. inStock=>true,
  27. store=>"45.17614,-93.87341",
  28. cat=>
  29. 0=>"electronics",
  30. 1=>"monitor",
  31. ),
  32. features=>
  33. 0=>"19\" TFT active matrix LCD, 8ms response time, 1280 x 1024 native resolution"
  34. )
  35. ),
  36. 1=>
  37. id=>"3007WFP",
  38. name=>"Dell Widescreen UltraSharp 3007WFP",
  39. manu=>"Dell, Inc.",
  40. includes=>"USB cable",
  41. weight=>401.6,
  42. price=>2199,
  43. price_c=>"2199,USD",
  44. popularity=>6,
  45. inStock=>true,
  46. store=>"43.17614,-90.57341",
  47. cat=>
  48. 0=>"electronics",
  49. 1=>"monitor"
  50. ),
  51. features=>
  52. 0=>"30\" TFT active matrix LCD, 2560 x 1600, .25mm dot pitch, 700:1 contrast"
  53. )
  54. )
  55. )
  56. )
  57. );
  58.  
  59. foreach ($results['response']['docs'] as $result) {
  60. var_dump($result);
  61. }
  62. ?>
Success #stdin #stdout 0.02s 13112KB
stdin
Standard input is empty
stdout
array(11) {
  ["id"]=>
  string(6) "VA902B"
  ["name"]=>
  string(49) "ViewSonic VA902B - flat panel display - TFT - 19""
  ["manu"]=>
  string(15) "ViewSonic Corp."
  ["weight"]=>
  float(190.4)
  ["price"]=>
  float(279.95)
  ["price_c"]=>
  string(10) "279.95,USD"
  ["popularity"]=>
  int(6)
  ["inStock"]=>
  bool(true)
  ["store"]=>
  string(18) "45.17614,-93.87341"
  ["cat"]=>
  array(2) {
    [0]=>
    string(11) "electronics"
    [1]=>
    string(7) "monitor"
  }
  ["features"]=>
  array(1) {
    [0]=>
    string(75) "19" TFT active matrix LCD, 8ms response time, 1280 x 1024 native resolution"
  }
}
array(12) {
  ["id"]=>
  string(7) "3007WFP"
  ["name"]=>
  string(34) "Dell Widescreen UltraSharp 3007WFP"
  ["manu"]=>
  string(10) "Dell, Inc."
  ["includes"]=>
  string(9) "USB cable"
  ["weight"]=>
  float(401.6)
  ["price"]=>
  int(2199)
  ["price_c"]=>
  string(8) "2199,USD"
  ["popularity"]=>
  int(6)
  ["inStock"]=>
  bool(true)
  ["store"]=>
  string(18) "43.17614,-90.57341"
  ["cat"]=>
  array(2) {
    [0]=>
    string(11) "electronics"
    [1]=>
    string(7) "monitor"
  }
  ["features"]=>
  array(1) {
    [0]=>
    string(71) "30" TFT active matrix LCD, 2560 x 1600, .25mm dot pitch, 700:1 contrast"
  }
}