How to simplify the following code
if($_MODULE[huoqubaobei]!="4"){$i=-1;$j=0; foreach($items as $item){$i++; $itemUrl = $uriManager->detailURI($item); $itemPicUrl = $item->getPicUrl(310); $itemTitle = $item->title; $itemPrice = $item->price; $itemsoldCount = $item->soldCount; echo''.$itemTitle.'¥'.$itemPrice.'
';}}else if($_MODULE[huoqubaobei]=="4"){$num = count($srtpdz); for($i=0;$i<$num;$i++) {echo''.$srbbbt[$i].'¥'.$srbbjg[$i].'
';}}
In this case, p + css is repeatedly written .. I thought for a few hours and I couldn't think of a good way. The main reason is that this cycle hurts ..
Reply to discussion (solution)
Estimate how much it can't be squeezed.
Because the mixed coding is too complicated, the template engine appears.
'. $ Srbbbt [$ I].'
¥
'. $ Srbbjg [$ I].'
';
I don't want to repeat this.
Nobody knows ???????????????????????
I really want to output the echo code using another function.
How to simplify it won't save much code, that's all.