Jcart Object(
[config] => Array
(
[jcartPath] => jcart/
[checkoutPath] => checkout.php
[item] => Array
(
[id] => my-item-id
[name] => my-item-name
[price] => my-item-price
[qty] => my-item-qty
[url] => my-item-url
[add] => my-add-button
)
[paypal] => Array
(
[id] => [email protected]
[https] => 1
[sandbox] =>
[returnUrl] =>
[notifyUrl] =>
)
[currencyCode] => USD
[csrfToken] =>
[text] => Array
(
[cartTitle] => Shopping Cart
[singleItem] => Item
[multipleItems] => Items
[subtotal] => Subtotal
[update] => update
[checkout] => checkout
[checkoutPaypal] => Checkout with PayPal
[removeLink] => remove
[emptyButton] => empty
[emptyMessage] => Your cart is empty!
[itemAdded] => Item added!
[priceError] => Invalid price format!
[quantityError] => Item quantities must be whole numbers!
[checkoutError] => Your order could not be processed!
)
[button] => Array
(
[checkout] =>
[paypal] =>
[update] =>
[empty] =>
)
[tooltip] => 1
[decimalQtys] =>
[decimalPlaces] => 1
[priceFormat] => Array
(
[decimals] => 2
[dec_point] => .
[thousands_sep] => ,
)
)
[items] => Array
(
[0] => 3
[1] => poslaju
)
[names] => Array
(
[3] => Hockey Stick
[poslaju] => Pos Laju
)
[prices] => Array
(
[3] => 33.25
[poslaju] => 6.00
)
[qtys] => Array
(
[3] => 1
[poslaju] => 3
)
[urls] => Array
(
[3] => http://bing.com
[poslaju] =>
)
[subtotal] => 51.25
[itemCount] => 4
)
我使用print_r($jcart)
得到上面的结果。 我只想打印出[qtys]
数组。我尝试print_r($qtys);
但它不起作用。如何打印_r选定的数组?
好像'$ jcart'是'Jcart'的实例,因此可能应参考'$ jcart-> qtys'? –
@SergeyChizhik啊,就这样。第一次阅读时我错过了。 – Machavity
非常感谢。它的工作 –