我在单身人类中有以下方法
private function encode($inp)
{
if (is_array($inp) {
return array_map('$this->encode', $inp);
} else if is_scalar($inp) {
return str_replace('%7E', rawurlencode($inp));
} else {
return '';
}
}
这作为一个普通的功能工作正常
function encode($inp)
{
if (is_array($inp) {
return array_map('encode', $inp);
} else if is_scalar($inp) {
return str_replace('%7E', rawurlencode($inp));
} else {
return '';
}
}
当在类里面使用我得到以下错误:
PHP Warning: array_map(): The first
argument, ‘$this->rfc_encode’, should
be either NULL or a valid callback
请任何人帮我解决这个问题.