我不知道该怎么办。我试图在我的函数内部与我的字符串进行会话并在它之外解析会话,如果这有意义的话....能做些什么来解决呢?
function api_info($form, &$form_state){
$server_url = 'website api url'
curl_setopt($ch, CURLOPT_URL, $server_url );
curl_setopt($ch, CURLOPT_POST, 0 );
curl_setopt($ch, CURLOPT_POSTFIELDS, );
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Expect:") );
curl_setopt($ch, CURLOPT_FAILONERROR, 1 );
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, );
curl_setopt($ch, CURLOPT_HEADER, false );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false );
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt($ch, CURLOPT_TIMEOUT, 120 );
curl_setopt($ch, CURLINFO_HEADER_OUT, true );
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
$xml_response_lead_point = curl_exec($ch);
$xml_request_lead_point = new SimpleXMLElement($xml_response_lead_point);
$result = reset($xml_request_lead_point->sm);
$xml_request = $xml_request_lead_point;
$xml_results = array(
'lead_response' => $result,
'results' => $xml_request,
);
//dvm($xml_results['results']);
//dvm($xml_request_lead_point);
//dvm($a);
$_SESSION['lead_results'] = $xml_results['results'];
return $xml_results;
}
$lead_results = $_SESSION['lead_results'];
var_dump($lead_results);