Solar_Json::_deQuote()

protected string Solar_Json::_deQuote ( string $encoded , array $keys )

Accepts a JSON-encoded string, and removes quotes around values of keys specified in the $keys array.

Parameters

  • (string) $encoded: JSON-encoded string

  • (array) $keys: Array of keys whose values should be de-quoted

Returns

  • (string) $encoded Cleaned string

Description

Accepts a JSON-encoded string, and removes quotes around values of keys specified in the $keys array.

Sometimes, such as when constructing behaviors on the fly for "onSuccess" handlers to an Ajax request, the value needs to not have quotes around it. This method will remove those quotes and perform stripslashes on any escaped quotes within the quoted value.



Local