Re: FW: [PHP] Accessing a Char in an Array

2004-12-21 Thread Curt Zirzow
* Thus wrote Justin Palmer: > Why is substr all over the board in how fast it processes the same > string? Is it the server? Benchmarking can be a funny thing. Usually benchmarks take an average of serveral thousand iterations in order to find the average time it take something to do. Benchmarki

RE: FW: [PHP] Accessing a Char in an Array

2004-12-21 Thread Justin Palmer
l; 'Curt Zirzow' > Subject: Re: FW: [PHP] Accessing a Char in an Array > > > On Tue, 2004-12-21 at 23:47, Justin Palmer wrote: > > *Sorry Curt for sending this to you.* > > > > Hi, > > > > Well if any one is interested in the speed I set up

Re: FW: [PHP] Accessing a Char in an Array

2004-12-21 Thread Robert Cummings
On Tue, 2004-12-21 at 23:47, Justin Palmer wrote: > *Sorry Curt for sending this to you.* > > Hi, > > Well if any one is interested in the speed I set up an example that you > can go to. Though, when I run the example substr() is very neurotic (or > it seems that it is to me). It can process the

FW: [PHP] Accessing a Char in an Array

2004-12-21 Thread Justin Palmer
ber 20, 2004 7:27 PM > To: 'PHP General' > Subject: Re: [PHP] Accessing a Char in an Array > > > * Thus wrote Justin Palmer: > > In an earlier thread labeled "first letter", it was suggested that > > substr() be used. > > Just for the record t

Re: [PHP] Accessing a Char in an Array

2004-12-21 Thread Curt Zirzow
* Thus wrote Justin Palmer: > In an earlier thread labeled "first letter", it was suggested that > substr() be used. Just for the record the usage of $str = 'a string'; $str[0]; Is strongly discouraged, it is recommended to use: $str{0}; See Section (String access and modification by ch

[PHP] Accessing a Char in an Array

2004-12-20 Thread Justin Palmer
In an earlier thread labeled "first letter", it was suggested that substr() be used. >Check this out... http://us2.php.net/manual/en/function.substr.php. So my question is: What is faster using substr or accessing the string like an array? I know I could test this myself, but I thought someone