[PHP] Ereg help

2002-10-25 Thread William Glenn
Hey all, I've been fighting this all night, I need a bit of help. I have a string like. #21-935 Item Description: $35.95 Where the part # could be 10-2034 a combination of 2 and 3 or 4 digits, and the price could be a combination of 1,2,3 . 2 digits. I want to chop that string into Part # / Des

[PHP] Ereg Help

2002-10-25 Thread David Pratt
Hi William, try this: ^(#[0-9]{2}-[0-9]{2,4} Item Description: [\$][0-9]{1,3}[\.][0-9]{2})$ I've just been putting a number of expressions together for validation myself. Regards, Dave Pratt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] ereg help

2001-12-03 Thread Valentin V. Petruchek
- Original Message - From: "Valentin V. Petruchek" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 03, 2001 6:35 PM Subject: [PHP] ereg help > I'm not new for php, but have no experience working with ereg functions. My > problem is

[PHP] ereg help!

2008-01-08 Thread steve
I have a dir of html files that link to websites, i would like to read the dir and print a list of those files as a link. Which the script i have does. I would like to take this one step further and replace the ".html" extension with ".com" so it winds up being: website.com instead of website.ht

Re: [PHP] Ereg help

2002-10-25 Thread Rick Emery
- Original Message - From: "William Glenn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 25, 2002 10:34 AM Subject: [PHP] Ereg help Hey all, I've been fighting this all night, I need a bit of help. I have a string like. #21-935 Item Des

[PHP] ereg() help, plz

2001-07-14 Thread McShen
hi, I wanna print out all files in a directory. But i wanna exclude ".", "..", "head.jpg", and all files that start with tn_ Here is my script, but it didn't work. Please help me to solve this problem. Thank You. -my script- while ($file_name = readdir($dir2)) if (($file_name!="."

Re: [PHP] ereg help

2001-12-03 Thread Jim
This is a good starter about PHP and regular expressions. http://www.phpbuilder.com/columns/dario19990616.php3 >- Original Message - >From: "Valentin V. Petruchek" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Monday, December 03, 2001

Re: [PHP] ereg help

2001-12-03 Thread J Smith
ms between the braces, and it's enough to get you started. J Valentin V. Petruchek wrote: > > - Original Message - > From: "Valentin V. Petruchek" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, December 03, 2001 6:35 PM > Subject: [

Re: [PHP] ereg help!

2008-01-08 Thread Chris
steve wrote: I have a dir of html files that link to websites, i would like to read the dir and print a list of those files as a link. Which the script i have does. I would like to take this one step further and replace the ".html" extension with ".com" so it winds up being: website.com instea

Re: [PHP] ereg help!

2008-01-08 Thread steve
On Tuesday 08 January 2008 20:30:29 Chris wrote: >I usually use preg_* functions so here's my go: >echo preg_replace('/\.php$/', '.com', $file); >The '$' at the end makes sure it's a .php file and won't cause problems >with files like xyz.php.txt . >(otherwise I'd just use a straight str_replac

Re: [PHP] ereg help!

2008-01-08 Thread Casey
On Jan 8, 2008, at 5:45 PM, steve <[EMAIL PROTECTED]> wrote: I have a dir of html files that link to websites, i would like to read the dir and print a list of those files as a link. Which the script i have does. I would like to take this one step further and replace the ".html" extension

Re: [PHP] ereg help!

2008-01-09 Thread Richard Heyes
$out = basename($file, ".html") . ".com"; fairly limited i think, but simple. Nothing wrong with being simple, and therefore both fast and easy to understand by a wider audience. The only downer I can immediately think of though is that whitespace isn't accommodated, but who really ends a fi

Re: [PHP] ereg help!

2008-01-09 Thread Anup Shukla
steve wrote: On Tuesday 08 January 2008 20:30:29 Chris wrote: I usually use preg_* functions so here's my go: echo preg_replace('/\.php$/', '.com', $file); The '$' at the end makes sure it's a .php file and won't cause problems with files like xyz.php.txt . (otherwise I'd just use a str

Re: [PHP] ereg() help, plz

2001-07-15 Thread Thomas R. Powell
Try this, while ($file_name = readdir($dir2)) { if ($file_name!="." && $file_name!=".." && $file_name!="head.jpg" && !ereg(^tn_,$file_name)) { $files[]=$file_name; } } $numfiles = count($files); for ($i=$g; $i<$numfiles; $i++){ echo $files[$i]; } Tom At 09:45 PM 7/14/01 -0400, you wrote: >