-1
I’m having stress problems in PHP.
In the database is inserted with the right accent, but when I return to PHP the accent is not returned correctly, someone can help me?
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<div class="busca">
<form action="">
<input type="search" name="busca" placeholder="Buscar" id="busca" required>
<input type="submit" value="Buscar" name="btn" id="btn">
</form>
<?php
$conexao = mysqli_connect("localhost","root","","dict2");
$busca = isset($_GET['busca'])?$_GET['busca']:"";
if (isset($_GET['btn'])){
$sql = "select * from tb_dict2 where def LIKE '%$busca%' OR trad LIKE '%$busca%'";
$result = mysqli_query($conexao,$sql);
while ($linha = mysqli_fetch_array($result)){
$trad = $linha['trad'];
$def = $linha['def'];
echo "<div class='content'>";
echo "<h3>Português: ".$def."<br>";
echo "Indonésio: ".$trad."<br>";
echo "</div";
}
}
?>
</div>
</body>
</html>