Escaping Quotes in a URL
So there has got to be a better way to get this to work. Here is what is working:
<?php
$url = $row_rsComments[url];
if(empty($url)){
echo $row_rsComments['name'];
}
else {
echo "<a href=\"";
echo $row_rsComments['url'];
echo "\">";
echo $row_rsComments['name'];
echo "</a>"; }
?>
However if I attempt to put the url into one echo statement it doesn't seem to work:
<?php
$url = $row_rsComments[url];
if(empty($url)){
echo $row_rsComments['name'];
}
else {
echo "<a href=\"$row_rsComments['url']\">$row_rsComments['name']</a>";
}
?>