Guest User

Untitled

a guest
Aug 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. how to add the integer values using foreach in php
  2. $qproducts = '0';
  3. foreach ($this->cart->getProducts() as $product) {
  4. $qproducts .= $product['quantity'];
  5. }
  6. $this->data['pquantity'] = $qproducts;
  7.  
  8. $qproducts = '0';
  9. foreach ($this->cart->getProducts() as $product) {
  10. $qproducts += $product['quantity'];
  11. }
  12. $this->data['pquantity'] = $qproducts;
  13.  
  14. $qproducts = 0;
  15. foreach ($this->cart->getProducts() as $product) {
  16. $qproducts += $product['quantity'];
  17. }
Add Comment
Please, Sign In to add comment