-->

Character Output - PHP Includes

2019-08-29 13:18发布

问题:

Here the problem - my html doc type heading is as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">

If I write some text which includes the '£' sign it displays correctly.

If I include a php script which uses the '£' sign I get strange character output:

I know that I can replace the £ with the html characters code '£' but since my site is large that is not practical.

Any suggestions?

Thanks!

回答1:

Can't you use the utf8_encode function?