note 100716 modified in function.curl-setopt by danbrown

From: Date: Tue, 02 Nov 2010 14:22:52 +0000
Subject: note 100716 modified in function.curl-setopt by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-173687@lists.php.net to get a copy of this message
This function helps to parse netscape cookie file, generated by cURL into cookie array: <?php function _curl_parse_cookiefile($file) { $aCookies = array(); $aLines = file($file); foreach($aLines as $line){ if('#'==$line{0}) continue; $arr = explode("\t", $line); if(isset($arr[5]) && isset($arr[6])) $aCookies[$arr[5]] = $arr[6]; } return $aCookies; } ?> --was-- This function helps to parse netscape cookie file, generated by cURL into cookie array: function _curl_parse_cookiefile($file) { $aCookies = array(); $aLines = file($file); foreach($aLines as $line){ if('#'==$line{0}) continue; $arr = explode("\t", $line); if(isset($arr[5]) && isset($arr[6])) $aCookies[$arr[5]] = $arr[6]; } return $aCookies; } http://php.net/manual/en/function.curl-setopt.php

« previous php.notes (#173687) next »