Solved

How can I display the photo number

Posted on 2011-03-15
2
214 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now