PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
xexexexe
Forum Newbie
Posts: 3 Joined: Mon Jul 15, 2002 6:47 am
Post
by xexexexe » Mon Jul 15, 2002 6:47 am
hi! i'm beginner at php... and i have a question: what should I do if I want that php print letters from A to Z?
for ex. in turbo pascal it's written like this:
for c:= 'A' to 'Z' do
writeln(c);
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Mon Jul 15, 2002 7:41 am
Another option is:
Code: Select all
<?php
for ($i = 'A'; $i != 'AA'; $i++) {
echo $i;
}
?>
Mac
gnu2php
Forum Contributor
Posts: 122 Joined: Thu Jul 11, 2002 2:53 am
Post
by gnu2php » Mon Jul 15, 2002 12:59 pm
You could also do this:
Code: Select all
for ($x = 0; $x < 26; $x++)
{
print chr($x + ord('A'))."\n";
}