Hi guys,
I haven't done that much research on this topic but it seems I can use
either the single quotes or the double quotes. SInce I am so used to C(++) I
prefer the double quotes and am wondering if they could possible be less
efficient. Maybe I should get in the habit of using single quotes with Php
instead ?
I like my code to be consistent, so in two very similar circumstances I
don't want one set of code using single quotes and the other double (I'm
kinda anal, what can I say ?)
Here are some simple and very common usages:
$fullname="Sata n"; // regular assignment that may of may not get passed to
function
$match="/[0-9]/"; // same but will definitely get passed to a function
preg_match($mat ch,$string);
$formdata=$_POS T["formData"]; // for arrays
I have lots of similar code all throughout my Php programs. So what do you
think, should I be using the single of double quotes in those situations ? I
want to get into a good habbit now so I can write some solid stuff that I
don't have to go back and change.
Take care,
Cyrus
I haven't done that much research on this topic but it seems I can use
either the single quotes or the double quotes. SInce I am so used to C(++) I
prefer the double quotes and am wondering if they could possible be less
efficient. Maybe I should get in the habit of using single quotes with Php
instead ?
I like my code to be consistent, so in two very similar circumstances I
don't want one set of code using single quotes and the other double (I'm
kinda anal, what can I say ?)
Here are some simple and very common usages:
$fullname="Sata n"; // regular assignment that may of may not get passed to
function
$match="/[0-9]/"; // same but will definitely get passed to a function
preg_match($mat ch,$string);
$formdata=$_POS T["formData"]; // for arrays
I have lots of similar code all throughout my Php programs. So what do you
think, should I be using the single of double quotes in those situations ? I
want to get into a good habbit now so I can write some solid stuff that I
don't have to go back and change.
Take care,
Cyrus
Comment