Skip to content

Instantly share code, notes, and snippets.

@leonardosapiras
Created July 26, 2011 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leonardosapiras/1106648 to your computer and use it in GitHub Desktop.
Save leonardosapiras/1106648 to your computer and use it in GitHub Desktop.
escape
foreach ($toplinks as $link) {
$tag = "\t<li><a";
foreach ($link['attr'] as $attr => $value) {
$tag.= " ".htmlentities($attr)."=\"".htmlentities($value)."\"";
}
$tag.=">";
$tag.= htmlentities($link['content']);
$tag.="</a></li>\n";
echo $tag;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment