-1

I want to echo html code with dots:

echo '<li>…</li>' . "\n";

But I get

<li>���</li>

How can I solve this problem?

name name2
  • 123
  • 4
  • 10

2 Answers2

2

Looks like an encoding problem. You should consider to declare your html in utf8 :

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

and make sure your file is utf8 encoded.

Pierre Granger
  • 1,993
  • 2
  • 15
  • 21
2

Because that's unicode:

Add

<meta http-equiv=Content-Type content="text/html; charset=UTF-8"> for HTML 4.01 & below
<meta charset="UTF-8"> for HTML5

Or execute

header("content-type: text/html; charset=UTF-8");

Or of course just do

echo '<li>...</li>' . "\n";

With normal full stops.

Did my answer solve your issue? Please make sure to mark it as accepted to help other people with the same problem.

sdr981
  • 405
  • 4
  • 15