- htmlspecialchars: documentation ( source)
- json_encode: documentation ( source)
<?php
$json_array = array(
'title' => '<a mouseover="alert(\"JOJOJO - GEILE Qoutes in deiner Nähe =\")"></a>'
);
$json_decode = htmlspecialchars(json_encode($json_array), ENT_QUOTES, 'UTF-8');
?>