hi, i have this string: $images = "image1.jpg,image2.jpg,image3.jpg,etc..."; Code (markup): how i can split this string to rows. i want something like this: <img src="image1.jpg"/> <img src="image2.jpg"/> <img src="image3.jpg"/> etc... Code (markup): how i can do this with PHP? thanks in advance.
<?php $images = "image1.jpg,image2.jpg,image3.jpg"; $pic = explode(",", $images); echo '<img src="' .$pic[0] . '">'; echo '<img src="' .$pic[1] . '">'; echo '<img src="' .$pic[2] . '">'; ?> Code (markup): This option is probable the best, as you could add a count function. <?php $images = "image1.jpg,image2.jpg,image3.jpg"; $pic = explode(",", $images); foreach($pic as $img) { echo '<img src="' .$img . '">'; } ?> Code (markup):