I am bringing some data from the database, and some of them have HTML
tags such as "<p>Hello</ p>
". However, when step data through to return it shows json_encode in "<p>Hello</p>
". What should I do to return the same data that was saved in the database?
PHP:
$retorna = array(
'conteudo_programatico' => $conteudo_programatico,
'investimento' => $investimento,
'coordenacao' => $coordenacao,
'importante' => $importante
);
echo json_encode($retorna);
AJAX:
$(function(){
$("button").click(function(){
var id = $(this).attr("id");
$.ajax({
type: "POST",
data: {id: id},
url: "paginas/ajax/form.php",
dataType: "json",
success: function(data){
$("#cursos").slideDown();
$(".call-conteudo").text(data['conteudo_programatico']);
$(".call-investimento").text(data['investimento']);
$(".call-coordenacao").text(data['coordenacao']);
$(".call-importante").text(data['importante']);
},
});
});
});