• Hi

    I’m having some troubles regarding my plugins encoding – ansi, utf8, etc. Any plugin I make, works in my website and in most of my users. However, in some, the plugin gives the “last character error” – namely in xampp, local, for testing purposes; instead of outputing a variable like <?php echo… xampp reads %3C?%20echo…

    Do I save the php files in plain ansi, in ascii mode? Or Unix? Or in utf8? New line and/or carriage return?…

    Is there a aprox. universal form for compatibility?

    Kind regards,

    • This topic was modified 6 years, 4 months ago by jkepler.
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    PHP files used by WP should be UTF-8 with no byte order mark. When creating PHP files, it’s customary to omit the final ?> closing tag. This prevents mysterious output from occurring when it is not appropriate. Any text after a closing ?>, even invisible white space, line feeds, etc., will cause possibly inappropriate output. Without the final tag, no output can occur unless it’s explicitly echoed or printed by PHP code. Extra whitespace within PHP tags has no impact on output.

Viewing 1 replies (of 1 total)
  • The topic ‘Code of php files’ is closed to new replies.