$s = "#12-3456 The Item description $35.43";

$qq = ereg("#([0-9]*-[0-9]*) ([a-zA-Z0-9 ]*) \\$([0-9]{1,3}\.[0-9]{2})", $s,$a);

$val = $a[1]."/".$a[2]."/".$a[3];
print $val;


----- Original Message -----
From: "William Glenn" <[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 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 # /
Description / Price.

I'd appreciate any help, I know this is probably real simple :) Thanks in advance.

William Glenn
Import Parts Plus

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to