i am very fresh to PHP..., in my journey i found some tedious situations..., i mean.. some times i saw $_REQUEST['email'] ( single quotes ) and in some sites... i saw $_REQUEST["email"] ( Double quotes ) in the case of include("welcome.php") orrrrr include('welcome.php') ----- Single quotes or double quotes......, which is correct.., and give me some tip to remember where we have to use single quotes and double quotes..... ------- Thanks a lot
Thats doesnt make any difference. PHP isnt like C/C++ where different qoutes have different meaning but in mysql_query(); statements, qoutes make some difference.
^^ no, there is always difference between the two, single quote is merely a string but double quote have to be evaluated by php if it contains variables in it.. like echo '$str is cool'; // would output: $str is cool $str = 'test'; echo "$str is cool"; // would output: test is cool PHP:
You should always pay attention to when you should use single or double quotes, helps to create a less resource hungry script.
As far as I know, single quotes are just for using strings inside them. as gapz101 said, you can use variables within double quotes. so logically, php interpreter would look for any variable if you would use strings double quoted (resource usage). I suggest you that, if you don't need to put any variable within a string, just use the string single quoted. good luck