How to retrieve special characters from MYSQL using PHP?
mysql_real_escape_string(string $unescaped_string, resource $link_identifier = NULL): string
where
mysql_real_escape_string(): It simply calls MySQL’s library function mysql_real_escape_string, which prepends backslashes. Such as \n, \r, \, ‘, ” and \x1a.
mysql_set_charset('utf8'); // It is used to retrieve special characters from MYSQL using PHP
Alternative way,
$mysqli = new mysqli("localhost", "user", "password", "db"); $mysqli->set_charset("utf8");
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> // It is used to retrieve special characters using HTML