Monday, April 3, 2017

Problem:
Encode js strings in PHP.

Solution:
$encodedStr = addslashes(htmlspecialchars($str));