Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php 5.3 CLI junk characters

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

like image 846
Hardik Soni Avatar asked Apr 18 '26 09:04

Hardik Soni


1 Answers

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).

like image 141
Carlos Campderrós Avatar answered Apr 19 '26 22:04

Carlos Campderrós



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!