Re: Ereg help
| From: | Rick Emery | Date: | Fri, 25 Oct 2002 15:05:38 +0000 |
| Subject: | Re: Ereg help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-121435@lists.php.net to get a copy of this message | ||
<?php
$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" <wglenn01@charter.net>
To: <php-general@lists.php.net>
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.
Thanks,
William Glenn
Import Parts Plus
http://www.importpartsplus.com