js_escape¶
Summary¶
- js_escape(string $value)¶
Escape the value for use in javascript.
This is a convenience function for encoding a value using JSON notation.Must be used when interpolating PHP output in javascript. Note on usage: donot wrap the resulting output of this function in quotes, as proper JSONencoding will take care of that.
Parameters: - $value (string) –
Returns: string