Solved

How can I display the photo number

Posted on 2011-03-15
2
217 Views
Last Modified: 2012-06-27
Hi,

I have a little photo gallery.

All photos are numbered starting with 01 (leading 0 included for photos 1-9)

I want to display that number in the "DISPLAY PHOTO NUMBER HERE (02 FORMAT)" area of the code attached.

Just the number "02", with out the file extension.

How can I do that?

Thanks!

<?
	for ($i = $start; $i < $limit; $i++) {
		if (!isset($photos[$i])) break; // No more photos
		echo '<a class="vlightbox1" href="' . $eventinfo['photo_path_url'] . '/web/' . $photos[$i] . '"><img src="' . $eventinfo['photo_path_url'] . '/thumbs/' . $photos[$i] . '" alt="Photo" border="0"/>'. $product_title .'DISPLAY PHOTO NUMBER HERE</a>';
	}
	?>

Open in new window

0
Comment
Question by:Computer Guy
2 Comments
 
LVL 2

Accepted Solution

by:
k_romych earned 500 total points
ID: 35140990
add   .'0'. in front of $photos[$i]
0
 
LVL 3

Author Comment

by:Computer Guy
ID: 35141049
With the code I gave as a demo, it does not add the photo number.

I would like to add the photo number.

The photos are like this: 01.jpg, 02.jpg, 03.jpg, 04.jpg, 05.jpg, 06.jpg, 07.jpg, 08.jpg, 09.jpg, 10.jpg, 11.jpg, etc....

I just want to display the number without extension in front of the </a> tag

PHOTO_NUMBER</a>
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question