runeveryday Posted October 22, 2011 Share Posted October 22, 2011 $col = 0; if ($num_products_count > 0) { while (!$specials_index->EOF) { $list_box_contents[$row][$col] = array('params' =>'<a href="#">' .zen_image(..). '</a>'), $col ++; } } now i want to pass some values<img src="1.jpg">,<img src="1.jpg">,<img src="2.jpg">,<img src="3.jpg">,<img src="4.jpg">,<img src="5.jpg"> to zen_image(..). how should i do? namely, if there are five loops.i want to change zen_image(..) output result to (<img src="1.jpg">,<img src="1.jpg">,<img src="2.jpg">,<img src="3.jpg">,<img src="4.jpg">,<img src="5.jpg">) Quote Link to comment Share on other sites More sharing options...
MarPlo Posted October 22, 2011 Share Posted October 22, 2011 Hi, You can pass an array of values to zen_image( ), then parse those values in that function. For each loop add a value in that array: $col = 0; if ($num_products_count > 0) { while (!$specials_index->EOF) { $val[] = $col + 1; // or what value you want $list_box_contents[$row][$col] = array('params' =>'<a href="#">' .zen_image($val). '</a>'), $col ++; } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.