문제

how do i convert below text to something like "Växjö" using PHP?

Växjö

I have tried

html_entity_decode(preg_replace("/U\+([0-9A-F]{4})/", "&#x\\1;", $text), ENT_NOQUOTES, 'UTF-8')
iconv(mb_detect_encoding($text, mb_detect_order(), true), "UTF-8", $text)
도움이 되었습니까?

해결책

Any PHP version from 5.0 onwards should be fine with...

$decoded = html_entity_decode('Växjö', ENT_COMPAT, 'UTF-8');

Demo here - http://3v4l.org/DZc59

다른 팁

echo html_entity_decode('Växjö', ENT_QUOTES, 'UTF-8');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top