Jump to content

foreach


canadabeeau

Recommended Posts

Hi I am running this code

		$images = $array['images'];
	$images = explode(";", $images);
	for ($i = 0, $len = strlen($images); $i < $len; $i++) {
		$images_exploded = explode("|", $images{$i});
		$title = $images_exploded[0];
		$description = $images_exploded[1];
		$image = $images_exploded[2];
		echo '<li>';
		echo '<h3>'.$title.'</h3>';
		echo '<span>http://'.$_SERVER['HTTP_HOST'].'/img/'.$image.'</span>';
		echo '<p>'.$description.'</p>';
		echo '<a href="#"><img src="http://'.$_SERVER['HTTP_HOST'].'/img/'.$image.'" height="75px" /></a>';
		echo '</li>';
	}

 

Problem is it is only doing the first images data before ; even though I have 2 setup it will only run the first

 

All help appreciated

Link to comment
https://forums.phpfreaks.com/topic/195186-foreach/
Share on other sites

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.