I know this is an old thread, but still very much relevant.
If you want control over quotes in your generated HTML, you can use the sprintf() function in PHP (and similar calls available in many other languages):
$html = sprintf('%s', $url, $text);
Using sprintf() allows the format string to be easily modifiable by retrieving it from a database or configuration file, or via translation mechanisms.
It is very readable, and allows either double or single quotes in the generated HTML, with very little change and never any escaping:
$html = sprintf("%s", $url, $text);