Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP] Wyciągnięcie zmiennej z tablicy
Forum PHP.pl > Forum > Przedszkole
kosynier8
Witam
Mam tablicę z allegro API która przez print_r zwraca takie dane jak poniżej
Jak wyciągnąć wartość it-buy-now-price
  1. (
  2. [array-item-list-info] => Array
  3. (
  4. [0] => stdClass Object
  5. (
  6. [item-info] => stdClass Object
  7. (
  8. [it-id] => 7022911760
  9. [it-country] => 1
  10. [it-name] => Materac 160x200 Kokos DAKOTA MAX Premium - 24 cm
  11. [it-price] => 0
  12. [it-bid-count] => 4402
  13. [it-ending-time] => 0
  14. [it-seller-id] => 37286481
  15. [it-seller-login] => MEBLE-SOFT
  16. [it-seller-rating] => 0
  17. [it-starting-time] => 0
  18. [it-starting-price] => 0
  19. [it-quantity] => 95410
  20. [it-foto-count] => 1
  21. [it-reserve-price] => 0
  22. [it-location] => BARTOSZYCE
  23. [it-buy-now-price] => 379
  24. [it-buy-now-active] => 1
  25. [it-advertisement-price] => 0
  26. [it-advertisement-active] => 0
  27. [it-high-bidder] => 0
  28. [it-high-bidder-login] =>
  29. [it-description] =>
  30. [it-standardized-description] =>
  31. [it-options] => 84247343
  32. [it-state] => 14
  33. [it-is-eco] => 0
  34. [it-hit-count] => 224464
  35. [it-postcode] =>
  36. [it-vat-invoice] => 1
  37. [it-vat-margin-invoice] => 0
  38. [it-without-vat-invoice] => 0
  39. [it-bank-account1] =>
  40. [it-bank-account2] =>
  41. [it-starting-quantity] => 100000
  42. [it-is-for-guests] => 1
  43. [it-has-product] => 0
  44. [it-order-fulfillment-time] => 24
  45. [it-ending-info] => 1
  46. [it-is-allegro-standard] => 0
  47. [it-is-new-used] => 1
  48. [it-is-brand-zone] => 0
  49. [it-duration-info] => stdClass Object
  50. (
  51. [duration-type] => 2
  52. )
  53.  
  54. [it-is-fulfillment-time-active] => 1
  55. [it-ean] =>
  56. [it-contact] =>
  57. )
  58.  
  59. [item-cats] => Array
  60. (
  61. [0] => stdClass Object
  62. (
  63. [cat-level] => 0
  64. [cat-id] => 5
  65. [cat-name] => Dom i Ogród
  66. )
  67.  
  68. [1] => stdClass Object
  69. (
  70. [cat-level] => 1
  71. [cat-id] => 522
  72. [cat-name] => Meble
  73. )
  74.  
  75. [2] => stdClass Object
  76. (
  77. [cat-level] => 2
  78. [cat-id] => 568
  79. [cat-name] => Sypialnia
  80. )
  81.  
  82. [3] => stdClass Object
  83. (
  84. [cat-level] => 3
  85. [cat-id] => 20292
  86. [cat-name] => Materace
  87. )
  88.  
  89. )
  90.  
  91. [item-images] => Array
  92. (
  93. )
  94.  
  95. [item-attribs] => Array
  96. (
  97. )
  98.  
  99. [item-postage-options] => Array
  100. (
  101. )
  102.  
  103. [item-payment-options] => stdClass Object
  104. (
  105. [pay-option-transfer] => 0
  106. [pay-option-on-delivery] => 1
  107. [pay-option-allegro-pay] => 1
  108. [pay-option-see-desc] => 0
  109. [pay-option-payu] => 1
  110. [pay-option-escrow] => 0
  111. [pay-option-qiwi] => 0
  112. )
  113.  
  114. [item-company-info] => stdClass Object
  115. (
  116. [company-first-name] =>
  117. [company-last-name] =>
  118. [company-name] =>
  119. [company-address] =>
  120. [company-postcode] =>
  121. [company-city] =>
  122. [company-nip] =>
  123. )
  124.  
  125. [item-product-info] => stdClass Object
  126. (
  127. [product-id] => 0
  128. [product-name] =>
  129. [product-description] =>
  130. [product-images-list] => Array
  131. (
  132. )
  133.  
  134. [product-parameters-group-list] => Array
  135. (
  136. )
  137.  
  138. )
  139.  
  140. [item-after-sales-service-conditions] => stdClass Object
  141. (
  142. [implied-warranty] =>
  143. [return-policy] =>
  144. [warranty] =>
  145. )
  146.  
  147. [item-additional-services-group] =>
  148. )
  149.  
  150. )
  151.  
  152. [array-items-not-found] => Array
  153. (
  154. )
  155.  
  156. [array-items-admin-killed] => Array
  157. (
  158. )
  159.  
  160. )
rad11
  1. $array['array-item-list-info'][0]->{'item-info'}->{'it-buy-now-price'}
kosynier8
Niestety nie działa sad.gif
Walczę walczę i nie mogę smile.gif
kreatiff
dodaj (string) przed to co podał rad11.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.