On Mon, 12 Mar 2001 12:10, John Vanderbeck wrote:
> I really wish I could figure these darn things out :) I have a task I
> need to do, and i'm certain I could do this easily with a regexp..
>
> I have a file name in the format MMDDYY-*.txt...I need to parse it to
> determine if the month and year matches a specified month and year.
> Day is irrelevant
>
> Can any of your regexp wizards help me?
A non-regexp solution that comes to mind is to use substr() to extract
the bits you want from the filename, assuming the filenames to be always
as your example. So:
$month = substr($filename,0,2);
$year = substr($filename,4,2);
Then you have the string values for month and year in the respective
variables.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]