Jump to content

Need to parse one char from string and assign it as a $var


phpretard

Recommended Posts

I have a list of pictures and I want to control the order.

 

Here is the picture format:
$pic = http://www.picture.biz/incoming/w_2GTEK13T961240561_1.jpg
$pic = http://www.picture.biz/incoming/w_2GTEK13T961240561_2.jpg
$pic = http://www.picture.biz/incoming/w_2GTEK13T961240561_3.jpg
$pic = http://www.picture.biz/incoming/w_2GTEK13T961240561_4.jpg
$pic = http://www.picture.biz/incoming/w_2GTEK13T961240561_5.jpg

Notice the order 1.jpg, 2.jpg, etc..

Here is where I'm stuck...

// begin stuck 
$orderPic = explode("_", $pic);

foreach($orderPic as $rank){
     echo "$rank"; // I need $rank to equal 1 then 2 then 3 ...
}

 

It would be nice actually if I could start the insert with number 2 because number one is always a screwy picture.

 

I hope this makes sense /  Thank for the help!

 

 

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.