Render HTML with wp_send_json

I’m trying to render HTML with wp_send_json, but it doesn’t work, HTML is not formatting :

if ( $lastTokens[0][‘token’] < $lastTokens[1][‘token’]) {
$prixachat_format = ‘<i class=”fas fa-arrow-down”></i> ‘.number_format($prixachat, 0, ‘,’, ‘ ‘);
} elseif ($lastTokens[0][‘token’] > $lastTokens[1][‘token’]) {
$prixachat_format = “<i class=”fas fa-arrow-up”></i> “.number_format($prixachat, 0, ‘,’, ‘ ‘);
} else {
$prixachat_format = “<i class=”fas fa-arrow-right”></i> “.number_format($prixachat, 0, ‘,’, ‘ ‘);
}

$result = array(
‘token’ => $prixachat_format,
);
wp_send_json($result);

It’s look like ” 1 200″ Any idea how can I solve this issue ?

Read more here:: Render HTML with wp_send_json

Leave a Reply

Your email address will not be published. Required fields are marked *