473,405 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Quick way to generate links?

Hi,

Using PHP 4.4.4, do any of you have a quick way to generate a list of
alphabetical links that link to <a name=""sections on my page? The
desired HTML would look like

<a href="A">A</a>&nbsp;
<a href="B">B</a>&nbsp;
....
<a href="#Z">Z</a>

Figured someone out there had a slick way to generate these.

Thanks, - Dave

Oct 10 '06 #1
2 1127

la***********@zipmail.com napisal(a):
Hi,

Using PHP 4.4.4, do any of you have a quick way to generate a list of
alphabetical links that link to <a name=""sections on my page? The
desired HTML would look like

<a href="A">A</a>&nbsp;
<a href="B">B</a>&nbsp;
...
<a href="#Z">Z</a>

Figured someone out there had a slick way to generate these.
for ($i=65;$i<=90;$i++)
echo "<a href=\"".chr($i)."\">".chr($i)."</a>&nbsp;";

Oct 10 '06 #2
la***********@zipmail.com wrote:
Hi,

Using PHP 4.4.4, do any of you have a quick way to generate a list of
alphabetical links that link to <a name=""sections on my page? The
desired HTML would look like

<a href="A">A</a>&nbsp;
<a href="B">B</a>&nbsp;
...
<a href="#Z">Z</a>

Figured someone out there had a slick way to generate these.
Here's a way to do it:

foreach(range("A","Z") as $i)
echo "<a href=\"#".$i."\">".$i."</a>&nbsp;";

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Oct 10 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.