[PHP] Re: Clean break.

2009-08-03 Thread Peter Ford
Paul Halliday wrote: > Whats the cleanest (I have a really ugly) way to break this: > > [21/Jul/2009:00:00:47 -0300] > > into: > > date=21/jul/2009 > time=00:00:47 > > Caveats: > > 1) if the day is < 10 the beginning of the string will look like > "[1/... > 2) the "-0300" will differ dependin

Re: [PHP] Re: Clean break.

2009-08-01 Thread ollisso
On Sat, 01 Aug 2009 01:37:56 +0300, Paul Halliday wrote: Actually, I don't think that regexp's are very slow :) But I haven't tested them from that perspective. You should just benchamrk different approaches :) btw, not sure that substr will help you a lot: first you have to get a begining

Re: [PHP] Re: Clean break.

2009-07-31 Thread Paul Halliday
I was trying to stay away from regex as much as possible due to the overhead? I might be wrong here. This script will be parsing a lot of requests/sec. Thousands, maybe more, which it also needs to toss into a DB. I want to try and keep it as fast as possible. This is tricky when you don't know wh

[PHP] Re: Clean break.

2009-07-31 Thread Ollisso
On Sat, 01 Aug 2009 00:22:21 +0300, Paul Halliday wrote: Whats the cleanest (I have a really ugly) way to break this: [21/Jul/2009:00:00:47 -0300] into: date=21/jul/2009 time=00:00:47 ... Why not just use regexp ? For example: $string = "long text.. multiply lines... [21/Jul/20