Solved

How can I display the photo number

Posted on 2011-03-15
2
213 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
Comment Utility
add   .'0'. in front of $photos[$i]
0
 
LVL 3

Author Comment

by:Computer Guy
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…

744 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

8 Experts available now in Live!

Get 1:1 Help Now