Forum Moderators: coopster

Message Too Old, No Replies

Misc PHP questions

         

netfiends

7:23 pm on May 8, 2005 (gmt 0)

10+ Year Member



Is it better to jump out of PHP to display html content or to just display it through php?

Does white space, tabs, etc... affect how long the code takes to run?

Is it better to use quotes when doing something like: $string = strtoupper($string);?

Longhaired Genius

8:09 pm on May 8, 2005 (gmt 0)

10+ Year Member



Tests have shown that code executes quicker if the script stays in php rather than doing a lot of jumping in and out. Personally, I don't use quotes if the code will work without them.

Stormfx

9:01 pm on May 8, 2005 (gmt 0)

10+ Year Member



I agreed with LG.

For HTML, I never jump in and out. I normally store the HTML in a seperate file and either include it or parse it with a function.

For the other matter, I always using single quotes with the exception of something I need parsed, such as "\r\n". And if I find myself doing that a lot, I normally define a constant or function for it so that I don't have to. :)

jatar_k

12:52 am on May 9, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



ergophobe took a look at this

Benchmarking PHP text output [webmasterworld.com]

I personally jump in and out all the time, no problems