From my site on WP i send to Telegram chat new posts, I use get_the_title()
, but if in the title have dash " -
" in Telegram chat this displayed as –
;
How this fix?
Asked
Active
Viewed 71 times
-2

Nazar
- 11
- 5
1 Answers
0
It is HTML entity. You can use html_entity_decode
to unescape it.
echo html_entity_decode('–'); // outputs "–"

Jax-p
- 7,225
- 4
- 28
- 58
-
but my "-" in function get_the_title(), which return "text – text text", how to be in this situation? @Jax-p – Nazar Dec 03 '21 at 12:17
-
`html_entity_decode(get_the_title())` – Jax-p Dec 03 '21 at 12:22
-
unfortunately, it didn't help – Nazar Dec 03 '21 at 12:29
-
So it escapes somewhere else. You gotta find it – Jax-p Dec 03 '21 at 12:30