-1

I have a problem with one of my PHP class. Unfortunately, I can't post it there for privacy issues and because it is more than 4000 lines. The fact is that when I include the class in other files it prints blank space in it. I tried to include that class also in a CSV download file and it put in it a blank line and these symbol 'Ôªø'. I try to check if there was some echo, print_r, or var_dump inside my class but there aren't, I also check the other classes included in that one but nothing. Are there any other ways my PHP file can print something?

I hope I have been clear enough, thanks.

  • 2
    https://stackoverflow.com/questions/1837626/what-is-this-string-%C3%94%C2%AA%C3%B8-and-how-do-i-avoid-it - `Ôªø` is likely a byte order mark. – CBroe Jan 13 '21 at 12:27
  • 1
    PHP still deals with byte order marks poorly. Assuming that all your stuff is encoded in UTF-8 (as it usually should be), save your files as “UTF-8 without BOM” to avoid such problems. – CBroe Jan 13 '21 at 12:28
  • @CBroe I try to search and I find that my editor is correctly saving the file as UTF-8 without BOM – fabio del carlo Jan 13 '21 at 13:08

2 Answers2

1

That class may include some files / call some functions / instantiate some other classes which can output something. You can add some "flags" in your code and check where exactly the blank space is printed.

1

Yes, another way your php file can print is a blank line outside tags, for instance:

<?php ?> 
<--- blank line after your tags.

Pay attenction to that.

Sandman
  • 1,480
  • 7
  • 23