Quantcast
Channel: Últimos conteúdos
Viewing all articles
Browse latest Browse all 14190

UTF-8 sem BOM

$
0
0

Gente, quando eu pego dados da minha tabela MySQL® fica feio, os acentos viram outros símbolos, e dentro da tag head já tem o meta utf-8. Como posso resolver isso?

Estou fazendo assim pra capturar os textos da tabela.

$sql   = "SELECT * FROM news ORDER BY `id` DESC";
$stmt  = NewDB::prepare($sql);
$stmt->execute();
$fetch = $stmt->fetchAll();

foreach($fetch as $row) {
	$id        = $row->id;
	$content   = $row->content;
	$breakline = nl2br(bbcode($content));
	$breakline = trim($breakline);
	
	echo '<p>' . $breakline . '</p>';
}

Obrigado desde já.


Viewing all articles
Browse latest Browse all 14190