Re: [PHP-DB] Letters loop

2005-05-26 Thread Jochem Maas
MIGUEL ANTONIO GUIRAO AGUILAR wrote: Hi!! I wanna a do a for loop with letters, Is this possible? for ($i = 'A'; $i <= 'Z'; $i++){ // code } try it. php -r ' for ($i = "a"; $i < "z"; $i++){ echo $i,"."; } echo "z";' -- MIGUEL GUIRAO AGUILERA Logistica R8 - Telcel

[PHP-DB] RE: Subject: Form information

2005-05-26 Thread Neil Smith [MVP, Digital media]
Message-Id: <[EMAIL PROTECTED]> From: "Chris Payne" <[EMAIL PROTECTED]> To: Date: Wed, 25 May 2005 00:53:59 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_NextPart_000__01C560C4.3CC5A710" Subject: Form information Hi there everyone, I'm pulling data f

[PHP-DB] RE : Subject: Letters loop

2005-05-26 Thread Neil Smith [MVP, Digital media]
for ($i=1; $i<=26; $i++) { print(chr(64+$i)); } chr() prints the ASCII character corresponding to that number. Upper case A-Z starts at 64 : http://www.lookuptables.com Cheers - Neil Date: Wed, 25 May 2005 20:37:47 -0700 From: MIGUEL ANTONIO GUIRAO AGUILAR <[EMAIL PROTECTED]> To: php-d

RE: [PHP-DB] Letters loop

2005-05-26 Thread Bastien Koert
try for ($i =ord( 'A'); $i <= ord('Z'); $i++){ // code } bastien From: MIGUEL ANTONIO GUIRAO AGUILAR <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: [PHP-DB] Letters loop Date: Wed, 25 May 2005 20:37:47 -0700 Hi!! I wanna a do a for loop with letters, Is this possible? for ($i = 'A';

RE: [PHP-DB] Letters loop

2005-05-26 Thread Miguel Guirao
Thanks!! I think the ord() function should receive an integer as a parameter and it returns it's corresponding character. But it will work!!! -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Jueves, 26 de Mayo de 2005 08:28 a.m. To: [EMAIL PROTECTED]; php-db@lists.ph

RE: [PHP-DB] RE : Subject: Letters loop

2005-05-26 Thread Miguel Guirao
This a better and small aproach!!! Thanks!!! -Original Message- From: Neil Smith [MVP, Digital media] [mailto:[EMAIL PROTECTED] Sent: Jueves, 26 de Mayo de 2005 07:35 a.m. To: php-db@lists.php.net Cc: [EMAIL PROTECTED] Subject: [PHP-DB] RE : Subject: Letters loop for ($i=1; $i<=26; $i++)

RE: [PHP-DB] Letters loop

2005-05-26 Thread Bastien Koert
nope chr ( int ascii ) takes the integer ord ( string string ) takes the string bastien From: Miguel Guirao <[EMAIL PROTECTED]> To: php-db@lists.php.net Subject: RE: [PHP-DB] Letters loop Date: Thu, 26 May 2005 09:22:56 -0500 Thanks!! I think the ord() function should receive an integer as

Re: [PHP-DB] Letters loop

2005-05-26 Thread Rasmus Lerdorf
Absolutely nothing wrong with that solution. But here is an alternative just for fun: for($letters = range('A','Z'), $i=0; isset($letters{$i}); $i++) echo $letters{$i}." "; -Rasmus Miguel Guirao wrote: > Thanks!! > > I think the ord() function should receive an integer as a parameter and it

[PHP-DB] printf() in a variable, or alternative to printf()

2005-05-26 Thread mayo
I need to be able to format data. Printf() is perfect because I need a certain amount of characters (30 for address). However I need this formatted data to be inside a file that's fwrite() and then FTPed to a distributor who will parse it and input into their database. printf("% 4d",$ord