- htmlentities: documentation ( source)
- json_encode: documentation ( source)
<?php
$titlex = 'string \' string';
$desc = $descx = $titlez = $titlex;
$do_file = null;
$r = htmlentities('updatepopup('.json_encode($titlex).', ' .json_encode($desc) .');', ENT_QUOTES);
$r2 = htmlentities('updatepopup('.json_encode($titlex).', ' .json_encode($descx) .');', ENT_QUOTES);
if ($do_file == "0") { echo "<tr title='".$titlez."' class='header' onClick='".$r."'>"; }
else { echo "<tr title='".$titlez."' class='header' onClick='".$r2."'>"; }