foreach echo loop
Posted: Thu Aug 18, 2011 8:57 pm
I have this statement:
pulse.add('pid','<?php foreach( $cart_order_id as $product_id ) {
echo $product_id . ', ';}?>');
this is my ouput at the moment:
// Product ID that the user is viewing
pulse.add('pid','433, 139, 393, 107, 330, ');
What I would prefer as my output is:
pulse.add('pid','433');
pulse.add('pid','139');
pulse.add('pid','393');
pulse.add('pid','107');
pulse.add('pid','330');
i think i need to echo "pulse.add('pid'," . $productId . ");" into my foreach loop or foreach then echo pulse inside to get my desired results.. but i'm having mass trouble with the syntax. ughhh.. any help would be greatly appreciated.

pulse.add('pid','<?php foreach( $cart_order_id as $product_id ) {
echo $product_id . ', ';}?>');
this is my ouput at the moment:
// Product ID that the user is viewing
pulse.add('pid','433, 139, 393, 107, 330, ');
What I would prefer as my output is:
pulse.add('pid','433');
pulse.add('pid','139');
pulse.add('pid','393');
pulse.add('pid','107');
pulse.add('pid','330');
i think i need to echo "pulse.add('pid'," . $productId . ");" into my foreach loop or foreach then echo pulse inside to get my desired results.. but i'm having mass trouble with the syntax. ughhh.. any help would be greatly appreciated.