问题
I am facing problem like whenever I run a simple php script from the command line, it is showing some junk character before it.
I am using php 5.3.9 on wamp server on windows 7.
Here is my code of my script
<?php
echo "Hi"; exit;
?>
and here is what i get in cli
Hi
Let me know if anyone else has faced same like problem and know the solution.
Thanks
回答1:
This is the UTF-8 BOM. In your editor, save the file as 'UTF-8 without BOM' (look for that setting, it must be there somewhere. If you can't find it, change your editor).
来源:https://stackoverflow.com/questions/13798455/php-5-3-cli-junk-characters