>>36
>$print_code .= q[Content-Type: text/html;charset=Shift_JIS] . qq[\n];
>$print_code .= q[<META http-equiv="content-type" charset="Shift_JIS">];

「html sjis meta」で検索すると、以下が見つかる。
上とは、ちょっと違う

<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">

他には、PHP で作ったそのファイルが、UTF-8 で保存されているとか?

「html sjis 文字化け」で検索すれば?

文字化けを防ぐ&解消する方法
https://www.be-webdesigner.com/tips/coding/mojibake.htm