企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
cookies原始字符串转换为数组 ``` ~~~ public function setCookieString($string) { $result = array(); if(preg_match_all('/\s*([^;=]+)=([^;]+)/i',$string,$matches) > 0){ if(isset($matches[1]) && isset($matches[2])){ if(count($matches[1]) == count($matches[2])){ foreach ($matches[1] as $handle => $key) { $result[$key] = $matches[2][$handle]; } } } } return $result; } ~~~ ```