I have this HTML that I generate with the function of php selectHorarios ()
<option>13:15</option>
<option>13:30</option>
<option>13:45</option>
<option>14:00</option>
That I send it with this PHP file
require "config/config.php";
require "listadoTurnosFunc.php";
$dia =
$datos = array(
'fecha' =>selectHorarios($_POST['medico'],$_POST['fecha'],$_POST['horadesde'],$_POST['horahasta']);
);
echo json_encode($datos, JSON_FORCE_OBJECT);
And I receive it with this javascript function to update a schedule selection
$("#fecha").on("change",function(){
selectHorarios = {
fecha: $('#fecha').val(),
medico: $('#medico').val(),
horadesde: $('#horadesde').val(),
horahasta: $('#horahasta').val()
};
$.post('buscadorSelectHorarios.php', selectHorarios, function(data,
textStatus) {
if(textStatus=="success"){
$("#fecha").html(data.fecha);
}
},
"json");
But the Json gives me back
{"fecha":"13:15<\/option>13:30<\/option>13:45<\/option>14:00<\/option>"}
There is a way to pass the html by json in php so that it takes the html characters as "/ < >" ?