Есть следующая функция:
public static function rule($id) {
$rs = iDB::row("SELECT * FROM `#iCMS@__spider_rule` WHERE `id`='$id' LIMIT 1;", ARRAY_A);
$rs['rule'] && $rs['rule'] = stripslashes_deep(json_decode($rs['rule']));
$rs['user_agent'] OR $rs['user_agent'] = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36";
spider::$useragent = $rs['rule']['user_agent'];//Ошибка в этой строке
spider::$encoding = $rs['rule']['curl']['encoding'];
spider::$referer = $rs['rule']['curl']['referer'];
spider::$cookie = $rs['rule']['curl']['cookie'];
spider::$charset = $rs['rule']['charset'];
return $rs;
}
При ее вызове возникает ошибка:
Warning: Illegal string offset 'user_agent'