- mb_convert_encoding: documentation ( source)
<?php
function conv($str): string
{
$res = '';
$res .= 'SJIS-win: ' . mb_convert_encoding($str, 'SJIS-win') . "\n";
return $res;
}
$res = '';
$res = conv('あ');
$res .= conv('~');
$res .= conv('\\');
$res .= conv('¥');
$res .= conv('‾');
echo $res;