Jump to content

how to pass the value in php


runeveryday

Recommended Posts

$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">)

Link to comment
https://forums.phpfreaks.com/topic/249585-how-to-pass-the-value-in-php/
Share on other sites

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 ++;
}
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.