You are here: Re: single quotes, double quotes and "undefined index" « PHP Programming Language « IT news, forums, messages
Re: single quotes, double quotes and "undefined index"

Posted by Michael Fesser on 07/13/07 22:40

..oO(Markus)

>Additionnally, if you want to be safe, you can just concatenate the string:
>$sql = "SELECT * FROM foo WHERE bar='".$_SESSION['bar']."'";

Sure, but IMHO this kind of defeats the purpose of double-quoted strings
in PHP. When I see something like

print "text ".$var." more text ".$anotherVar." and so on";

or even worse

print "<a href=\"".$url."\">".$text."</a>";

then I'm getting...what's that in English - goose bumps (de: Gänsehaut)?
It's just terrible and hurts the eye of an experienced programmer. Not
to mention that jumping in and out of string parsing and mixing it with
escaping and different quote signs is very error-prone.

Micha

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация