Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-29 Thread Jochem Maas
James Ausmus schreef: On Tue, Aug 26, 2008 at 10:08 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 26 August 2008 17:15, James Ausmus advised: On Tue, Aug 26, 2008 at 8:57 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 25 August 2008 00:54, Govinda advised: snip Personally, I might be tempted to

RE: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread Ford, Mike
On 25 August 2008 00:54, Govinda advised: if (stripos(strrev($file), gpj.) === 0) { echo $file; } note the ===, 3 equals signs here is very important! check the docs for why. == means 'equals', and === means 'is identical to'. Seems like they would do the same thing when

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread James Ausmus
On Tue, Aug 26, 2008 at 8:57 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 25 August 2008 00:54, Govinda advised: snip Personally, I might be tempted to do something like this: if (($pos = strrchr($file, '.'))!==FALSE): switch (strtolower(substr($file, $pos))): case '.gif':

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread Lupus Michaelis
Ford, Mike a écrit : case '.gif': case '.png': case '.jpg': case '.jpeg': echo $file; Be carefull. The « extension » is just a clue to know what filled the file. See http://fr3.php.net/manual/en/book.fileinfo.php. -- Mickaël Wolff aka Lupus

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread Lupus Michaelis
Ford, Mike a écrit : case '.gif': case '.png': case '.jpg': case '.jpeg': Be careful. The end of the filename is just a clue on what is filled the file. See http://fr3.php.net/manual/en/book.fileinfo.php for more acurate result. -- Mickaël Wolff aka

RE: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread Ford, Mike
On 26 August 2008 17:15, James Ausmus advised: On Tue, Aug 26, 2008 at 8:57 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 25 August 2008 00:54, Govinda advised: snip Personally, I might be tempted to do something like this: if (($pos = strrchr($file, '.'))!==FALSE): switch

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-26 Thread James Ausmus
On Tue, Aug 26, 2008 at 10:08 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 26 August 2008 17:15, James Ausmus advised: On Tue, Aug 26, 2008 at 8:57 AM, Ford, Mike [EMAIL PROTECTED] wrote: On 25 August 2008 00:54, Govinda advised: snip Personally, I might be tempted to do something like

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-25 Thread David Otton
2008/8/24 Govinda [EMAIL PROTECTED]: $ThisDir = getcwd()./thumbs; $DirHandle = opendir($ThisDir); if ($DirHandle = opendir($ThisDir)) { echo Directory handle: $DirHandle\n; echo Files:br /hr width=\25\%\ align=\left\ /; while ((false !== ($file = readdir($DirHandle))) 1) { if

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-25 Thread Jochem Maas
Chris schreef: if (stripos(strrev($file), gpj.) === 0) { echo $file; } note the ===, 3 equals signs here is very important! check the docs for why. == means 'equals', and === means 'is identical to'. Seems like they would do the same thing when comparing '0' to 'the position in the

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-25 Thread David Otton
2008/8/25 David Otton [EMAIL PROTECTED]: You can check the manual for full details, but briefly, sql_regcase() returns a case-insensitive regular expression, and glob() returns an array of filenames that match the path given to it (in this case ./thumbs/*.jpg). I should have mentioned that

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-25 Thread Philip Thompson
On Aug 24, 2008, at 6:54 PM, Govinda wrote: Should I send replies to just the list?, or is the etiquette to reply-to-all? You will get different opinions from different people on the list. IMO, Reply-All is really annoying. Since I'm on the list, there's no need to reply to me - I'll get

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-25 Thread tedd
At 7:53 AM -0500 8/25/08, Philip Thompson wrote: On Aug 24, 2008, at 6:54 PM, Govinda wrote: Should I send replies to just the list?, or is the etiquette to reply-to-all? You will get different opinions from different people on the list. IMO, Reply-All is really annoying. Since I'm on the

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-25 Thread Philip Thompson
On Aug 25, 2008, at 8:16 AM, tedd wrote: At 7:53 AM -0500 8/25/08, Philip Thompson wrote: On Aug 24, 2008, at 6:54 PM, Govinda wrote: Should I send replies to just the list?, or is the etiquette to reply-to-all? You will get different opinions from different people on the list. IMO,

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-25 Thread Wolf
!-- SNIP -- I'm using Eudora for the Mac and the first 32 lines of all my emails are the header and if I click the Blah Blah button (that's supposed to show the header information), then I get another 25 lines of header. That's 57 lines in total to get to the contents of the email -- far

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-24 Thread Chris
But two of those entries are apparently named . and ... Right. That's linux doing that, not php. If you jump into a ssh connection and do an $ ls -la you will see . and .. at the top. if ($filename == '.' || $filename == '..') { continue; } I haven't yet found the

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-24 Thread Jochem Maas
Govinda schreef: Hi all :-) It'll be fun to work here with you guys over the coming months. fun? work? you must be new :-) I have been out of the coding loop for 7 years, and I am totally new to PHP, but I should catch up not-too-slowly as I used to code HTML, WebDNA, and a little Visual

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-24 Thread Govinda
Should I send replies to just the list?, or is the etiquette to reply- to-all? fun? work? you must be new :-) new to PHP; could get boring after a long time with it, sure... but I have that 'coder's bug'... i.e. once fluent, then creatively solving problems is fun! okay enough jokes

Re: [PHP] newbie Q: How to say, if the fileNAME is equal to..., or better yet, if the fileNAME ends with '.jpg'?

2008-08-24 Thread Chris
if (stripos(strrev($file), gpj.) === 0) { echo $file; } note the ===, 3 equals signs here is very important! check the docs for why. == means 'equals', and === means 'is identical to'. Seems like they would do the same thing when comparing '0' to 'the position in the string where