1

When i require a php file, it prints a symbol.

Code:

    echo 'test'; 
    include('1.php');
    echo 'test';

Result in browser:

testtest

BUT! When I tried to parse a page with Jquery Json parser, It returned an error, because it said that there is a symbol right in the place where require function was called. You can't see this symbol in browser, but online Json parser can.

Copy and paste the result from browser to online Json parser: screenshot

So the question is how do I fix this error? And yes, there are 100% no empty spaces anywhere in included code or somewhere else.

Syed mohamed aladeen
  • 5,943
  • 3
  • 25
  • 53

1 Answers1

1

There is a chance of the required file to have a UTF8 encoding with BOM characters. If that's the case you could try converting your file (1.php) to UTF8 without BOM.

More about BOM here

Community
  • 1
  • 1
Orestis Samaras
  • 123
  • 2
  • 9