Hi there.
I was wondering if there is actual difference ' and ".
I kinda thought it was like preference, some people like to put ' and others ".
But I was reverse engineering some jQuery plugin and I noticed both ' and ".
There was actually no reason. I know that you can't use " inside " like in PHP, ie.:
echo "Your ID is: '. $id ."'.";
But there was no requirement to use both of them in one file.
If I would replace them all with " or ', file would work exactly same.

Any ideas?
You may consider it stupid. But I am just interested. It's an discussion, not real question.

http://www.php.net/manual/en/language.types.string.php

Basically, a double quoted string is parsed for embedded variables, a single quoted string is not.

echo "Your ID is: '$id'";
echo "Your ID is: \"$id\"";

Javascript accepts both equally, but technically they should be single quoted (historically).

commented: Well, that was a nice explanation, thank you! +2
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.