我正在尝试在我的库中调用安全类的xss_clean函数.这是我正在使用的:
array_map('$this->CI->security->xss_clean', $shipping_info);
Run Code Online (Sandbox Code Playgroud)
$shipping_info是一个数组.
CI是我在构造函数中实例化的全局CodeIgniter对象:$this->CI =& get_instance();
这是php错误:
array_map() expects parameter 1 to be a valid callback, function
'$this->CI->security->xss_clean' not found or invalid function name
Run Code Online (Sandbox Code Playgroud)
尝试:
<?php
array_map(array($this->CI->security, 'xss_clean'), $shipping_info);
Run Code Online (Sandbox Code Playgroud)