I created config.conf as a configuration file, I want to use the Smarty template to import and output in the page
Php,html and config.conf are encoded as Utf8,firefox browser Unicode
The page was garbled.
I changed config.conf to ANSI encoding.
I infer that it may be related to the encoding of Smarty itself.
I copied a smarty package from someone else (my own is the latest version from the official website), the page shows normal no garbled.
Config.conf Enter information as follows
Webtitle= Dangdang, the world's largest Chinese online bookstore copyright= Dangdang icpnum = 123456
HTML code
<{config_load file= "config.conf"}><{#webTitle #}>
---------Configuration file Demo----------
Copyright |
<{#copyRight #}> |
<{#icpNum #}> |
PHP code
Left_delimiter= "<{", $smarty->right_delimiter= "}>", $smarty->display ("index.html"); >
I would like to ask if you still use the original Smarty package, how to solve the above problems, thank you
Reply to discussion (solution)
Try to change config.conf to Utf-8 code without BOM.
Try to change config.conf to Utf-8 code without BOM.
Thanks for upstairs! I read some of the posts, using Notepad to save the BOM, and PHP is not support BOM, will lead to errors.
Finally, I use PHP to save PHP files, modify the suffix, error correction.