My way to hide email using JavaScript:

function ml(usr, dmn) {
    document.write(
        '<a href="mailto:'+usr+'@'+dmn+'">'+usr+'@'+dmn+'</a>'
    );
}

And how to use it in (X)HTML:

<script type="text/javascript">ml('bukaj','bukaj.net');</script>

You may also use it from PHP:

<?php

    function showMail($email) {
        list($usr,$dmn)=explode('@',$email);
        echo("<script>ml('".$usr."','".$dmn."');</script>");
    }

?>

And how to call it from PHP:

<?php
    showEmail("nobody@nonexistant-domain.tld");
?>