Hello, I still dont have the pattern syntax down... could someone help me with this one?
I have:
$date = "(Date Feb-12-03 14:31:31 ) ";
I want:
$date ="(Date Feb-12)";
Could someone help me out on this one? Thanks!
You realize you can probably use the date() and strtotime() functions to accomplish the same thing... Depending on where your information is comming from in the first place
PHPDev
Actually, I do not use these functions to get this string. It is read from an outside source and I want to change it...
Originally posted by PHPdev You realize you can probably use the date() and strtotime() functions to accomplish the same thing... Depending on where your information is comming from in the first place PHPDev
try this...
preg_replace('/\-[0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} /',"",$date);
Im sure you have probably seen this before but here is an article at PHPBuilder on Reg Expressions. The preg (Perl Regular expressions) are a little different
http://www.phpbuilder.com/columns/dario19990616.php3
Hope This helps...
PHPdev