in wordpress , i set a variable in header.php

<?php
$var= 'anything'
?>

but in footer.php when I echo it

<?php
echo $var;
?>

I got no thing printed ... why !>

Edit
Report