|
|
 |
Re: FN-FORUM: PHP Quotes, was php coding style
date posted 21st November 2006 17:26
I think, but don't quote me on this, that PHP code runs slightly faster
when you use {} instead of ".."/'..'.
Also, {} is usually much easier to read.
Tam Denholm wrote:
>
> Following the discussion about coding style, i was wondering if anyone
> had any points on quotes and the use of {} in queries etc.
>
> Personally, i do this:
> $q_str = "SELECT whatever FROM table WHERE id = '".$_POST['id']."'";
> but i know some people do this:
> $q_str = "SELECT whatever FROM table WHERE id = '{$_POST['id']}'";
>
> I have actually never came across a tutorial on using {} (maybe
> because i dont read basic tutorials any more) and i only found out
> about the {} method from seeing other peoples code.
>
> So anyone know where it comes from? Pro's, con's etc?
>
> Cheers
> Tam Denholm
>
|
 |
|