Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I found some special characters in my PHP script. One of them is Γ??. It's actually a special character of a dash -. How should I convert it back to dash so I can process the string?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
378 views
Welcome To Ask or Share your Answers For Others

1 Answer

I found the answer! It's inspired by this answer

$title = "Hunting, Tactical & Outdoor Optics eCommerce Store Γ?? $595,000 Γ?? SOLD";
$title = str_replace(html_entity_decode('–', ENT_COMPAT, 'UTF-8'), '-', $title);
$title = str_replace(html_entity_decode('—', ENT_COMPAT, 'UTF-8'), '-', $title);

Replacing the character right away won't work. html_entity_decode is definitely needed.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...