Re: Finding a File

From: Date: Fri, 21 Sep 2001 21:48:13 +0000
Subject: Re: Finding a File
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-68223@lists.php.net to get a copy of this message
Well - I just spoke with the client and apparently only one directory was going to create that problem so they're just going to rename the directory. I guess I should have tried that solution first. However, is there a way to read the string up to the point where the numbers start? For example, pull "AS" out of "ASxxxxx" and "MAS" out of "MASxxxxx"? I looked through the string functions and didn't really see anything to promising. Something like is_letter() would be cool :) Thanks, Joe Joseph Koenig wrote: > > Hello everyone -- I'm just a little bit stumped on this. I've got some > files that are available for user download, however, the files are in > different directories. The file names are based on the item number which > is available. For example, item number "AS1000-01" is in directory "AS" > and is named "AS1000-01.xxx" -- All files will have the same extension. > That's no problem. Where I'm confused is not all of the directories are > 2 letter names. For example, file "BSEB10-010" is in the "BSE" > directory. Some directories are 4 characters long -- all except the > BSEB**-*** files match their directory names until the file name > contains a number (ASxxxx is in "AS", MASxxxx is in "MAS", etc). I need > this script to be as dynamic as possible. I don't want to set up arrays > of directory names or anything. Can I run through the string of item > numbers until I hit a numeric character, and then check that substring > to see if it's a directory? If it doesn't match exactly is there a way > to search for that file in directories that almost match? Any ideas? Thanks, > > Joe > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#68223) next »