PHP Breaking up a sting

Status
Not open for further replies.

ziycon

New Member
I have a string like so 1;23;5;67;12;32;6;3;77;11;2 what im trying to do is take all the numbers and then output them like below:

1.jpg
23.jpg
5.jpg
67.jpg
12.jpg
32.jpg
6.jpg
3.jpg
77.jpg
11.jpg
2.jpg

If you get me!??
 

ph3n0m

New Member
well as long as it will always be x.jpg, you could do this

Code:
$numbers  = "1;23;5;67;12;32;6;3;77;11;2";
$pieces = explode(";", $numbers);

for($i=0;$i<count($pieces);$i++){
 echo $pieces[$i].".jpg<br/>";
}
 
Status
Not open for further replies.
Top