Re: [PHP] String format problem

2005-09-01 Thread Oliver Grätz
Please keep in mind you are speaking about microseconds of performance improvements. Optimising on this level is complete and utter nonsense. Using output buffering may give your application a much higher performance boost. And then you can still use a cache (opcode cache, page cache, ...) which gr

Re: [PHP] String format problem

2005-09-01 Thread tg-php
Wow! Fantastic rundown Satyam! Thanks for posting such a complete analysis. I had no idea that you could use commas instead of periods to join multiple strings much less do it without concatinating, that's very interesting. I don't think I've ever seen that used in any sample code before. I'm

RE: [PHP] String format problem

2005-09-01 Thread Ford, Mike
On 31 August 2005 16:56, [EMAIL PROTECTED] wrote: > $varname = '$firstname $lastname told me to find the file in folder > C:\newtext\'; echo $varname; > > > Yields.. > > $firstname $lastname told me to find the file in folder C:\newtext\ Actually, that'll give you an error as well, since \' is

Re: [PHP] String format problem

2005-09-01 Thread Mark Rees
> In fact, this is a poor example since the difference gets larger with longer > string and more arguments. When you use dots, the interpreter has to > actually concatenate the string, looking for memory to do so and freeing it > up afterwards. This takes time. With commas, each argument is sent

RE: [PHP] String format problem

2005-08-31 Thread Jim Moseby
> hi > i have a problem when i am formating a string > the problem is it converts the \n in the string to a new line > here is the code > > $Text = "D:\AppServ\www\intranet\admin\store\nodirectory\sub"; > $Replace = "D:\AppServ\www\intranet\admin\store"; > $with = "http://localhost/bank/admin/sto

Re: [PHP] String format problem

2005-08-31 Thread Satyam
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > To elaborate on Philip's response (which is correct)... [] > > > I've read "never use double quotes unless you have to" because it could > potentially speed up PHP a little because it won't be trying to interpret > every string.

Re: [PHP] String format problem

2005-08-31 Thread tg-php
To elaborate on Philip's response (which is correct)... Anything in double quotes (" ") will be interpreted by PHP before figuring out what the actual value is. Items like \n, \t, etc are therefore converted to a newline (\n) or a tab (\t) before assigning to the variable. Variables within t

Re: [PHP] String format problem

2005-08-31 Thread Philip Hallstrom
hi i have a problem when i am formating a string the problem is it converts the \n in the string to a new line here is the code http://localhost/bank/admin/store";; //$doc = str_replace ($Replace, $with, $Text); $doc = str_replace( '\\', '/', str_replace( $Replace, $with, $Text ) ); echo $doc;

Re: [PHP] String format problem

2005-08-31 Thread Robin Vickery
On 8/31/05, Ahmed Abdel-Aliem <[EMAIL PROTECTED]> wrote: > hi > i have a problem when i am formating a string > the problem is it converts the \n in the string to a new line > here is the code > > $Text = "D:\AppServ\www\intranet\admin\store\nodirectory\sub"; > $Replace = "D:\AppServ\www\intranet