To get single quotes into a single-quoted string, you double it:
echo 'That''s the way.';
To get double quotes into a double-quoted string you escape it:
echo "He said, \\"Do this.\\"";
Reverse it and you get:
echo "That's the way.";
echo 'He said, "Do this."';
So there are lots of ways to do it. As a style issue, I prefer to only use double quotes when outputting text to the browser and dropping in values as I go. Within array keys, I always use single-quotes.
Poorly-documented gotcha. What's the difference?
echo "This belongs to $user["name"].";
echo "This belongs to $user['name'].";
echo "This belongs to $user[name].";
echo "This belongs to ".$user["name"].".";
echo "This belongs to ".$user['name'].".";
echo "This belongs to ".$user[name].".";
echo 'This belongs to '.$user["name"].'.';
echo 'This belongs to '.$user['name'].'.';
echo 'This belongs to '.$user[name].'.';
If I remember correctly, the first two don't work, the third one does. The last six all work, but the second-to-last is the way I'd do it. It's unambiguous and easy to read.
Oh, and while I can't remember the exact syntactic difference, I know I prefer a period instead of a comma in echo 'The time is now ',$time;