Well, you forgot to change one single quote to a double quote since you are using double quotes as string delimiters now.
Aside from that, you need to concatenate (i.e. join) the urlencode() part to the rest of the string properly.
The result should then be:
<?php
echo "<a href=\"printlegal.php?pageid=" . urlencode($_GET['pageid']) . "\" class=\"bodynav\">Printer Friendly</a>";
?>