src/Helpers/Request/ArrayHelper.php
public function htmlEncode($data, $valuesOnly = true, $charset = null)
    {
        return $this->proxyWithCharset(__FUNCTION__, [$data, $valuesOnly, $charset]);
    }
public function htmlEncode($data, $valuesOnly = true, $charset = null)
    {
        return $this->proxyWithCharset(__FUNCTION__, [$data, $valuesOnly, $charset]);
    }
Encodes special characters in an array of strings into HTML entities.
Only array values will be encoded by default.
If a value is an array, this method will also encode it recursively.
Only string values will be encoded.
@param array $data data to be encoded
@param bool $valuesOnly whether to encode array values only. If false,
both the array keys and array values will be encoded.
@param string $charset the charset that the data is using. If not set,
[[\app\run\Application::charset]] will be used.
@return array the encoded data
@see http://www.php.net/manual/en/function.htmlspecialchars.php
@see \Reaction\Helpers\ArrayHelper::htmlEncode()