It get's echoed, but you won't see anything on your page as the text will be written within the Javascript-tag which is not displayed by the browser. Look at your page source to verify that the text is really there.
EDIT
Try
if(<?php echo json_encode($re); ?>){
document.getElementById('hide').style.display = "none";
}
This will ensure that your PHP string will be converted into the appropriate Javascript type - in case of strings it'll ensure that the string is enclosed in " and is escaped properly.
EDIT again
When you do the following
<script type="text/javascript">
if(<?php echo $re; ?>){
document.getElementById('hide').style.display = "none"; }
</script>
this is what is written to the HTML page (that's then interpreted by the browser)
<script type="text/javascript">
if(whatever is in the $re variable){
document.getElementById('hide').style.display = "none"; }
</script>
But this is not even valid Javascript. What you want is
<script type="text/javascript">
if("whatever is in the $re variable"){
document.getElementById('hide').style.display = "none"; }
</script>
Note the " which ensures that the whole thing is valid Javascript and that the contents of $re will be interpreted as an Javascript string by the Browser's Javascript engine. The call to json_encode() does exactly this - it transforms PHP variables into the appropriate Javascript variables.