tags:

views:

71

answers:

1

Can I store a special character inside a variable?

I mean something like:

<?php
$variable='&nbsp;&nbsp;' 

Then can i use something like echo $variable?

+2  A: 

Yes, but don't take my word for it:

#!/path/to/php
<?
$variable = '&nbsp;&nbsp;';
echo $variable;
?>
Myles
What is #!/path/to/php ? This is not Perl.
metrobalderas
Really? Is that why I said /path/to/php? http://www.php-cli.com/ As of PHP 4 you can run PHP scripts just like you can perl, bash, etc., by specifying the interpreter at the top of the file. I hope I wasn't downvoted for you not knowing that...
Myles
@Myles: sigh, looks like you were. some people...
hobodave
@hobodave, sigh indeed.
Myles