开发者

Simple PHP Image Scroller

I'm very new to PHP and I'm trying to build a simple image scroll-through which would consist of the picture as well as a next link and a previous link which would go to the next/previous pictures开发者_StackOverflow社区 stored in a directory. Right now all I have is an array of the filenames.

I did a bit of searching and haven't found any tutorials on doing this, but does anyone know of any links where I might find some help? Thanks.


well you could link the array index through get and then use it as key to show the url of the image

foreach($array as $k=>$v){

echo '<a href="'.$_SERVER['PHP_SELF'].'?index='.$k.'"></a>';//creates the link for diffrent images
}

echo '<img src="'.$array[$_GET['index']].'"/>';//show the image
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜