PHP Print puts false characters on a web page when printing starts (ï "¿)

When I turn on some PHP on my page to fill in the HTML download, everything precedes the symbols ï "¿. It's probably something stupid, but it turns me on. I'm new to PHP, so please pay attention to children's gloves.

This is my inclusion statement <?php $PSName="Solar Numbers"; $whereto="bot"; include("../php/menu.inc.php");?>

and this is the code doing the damage

   print <<<END
<a href="$pgurl">
<div id="layer1" style="background: url('$picurl'); 
position: absolute; width: 150px; height: 41px; z-index: 1; color: #FFFFFF; font: caption;
left: 14px; top: $topstr;
font-family: Arial, Helvetica, sans-serif; font-weight: bolder; text-decoration: none;
text-transform: capitalize; text-align: center; vertical-align: middle; font-size: xx-small;">
<br>
<font size="+0">$pgnm</font>
</div>
</a>
END;

it is displayed several times in a loop in the program, and only the first time I get false characters.

help me please

Stevek

+3
source share
4 answers

Save the file as UTF-8 without a signature (BOM).

U + FEFF Unicode, UCS-2, UCS-4, UTF-16 UTF-32, ( big-endian) - . , , , , Unicode. , PHP ( UTF-8), PHP , - , PHP, . , cookie , , PHP .

+1

UTF-8 BOM.

0

Dreamweaver, :

use utf8 BOM [x]

(menu.inc.php) ( ).

0
source

Reeeeeeeeeally late I know, but this little piece of HTML got rid of it without problems:

<meta charset="utf-8" />

Hope this helps someone :)

0
source

Source: https://habr.com/ru/post/1759962/


All Articles