How is the best way to send string from javascript to php with html tags inside? I'm trying, but all html tags disappear.
var ajaxData = '<div>some <b>text</b></div>';
jQuery.ajax({
url: url,
type: 'POST',
dataType: 'json',
data: ajaxData,
});
but in my php code var_dump($input); shows string like that: 'some text' instead
'<div>some <b>text</b></div>'
even this doesn't work
htmlspecialchars(urldecode($input));
data: ajaxDatawith something like thisdata: {'ad': ajaxData}urldecodeon$inputeither if it comes from one of the request superglobals.