note 39459 deleted from function.curl-exec by betz
| From: | betz@php.net | Date: | Fri, 23 Apr 2004 09:16:56 +0000 |
| Subject: | note 39459 deleted from function.curl-exec by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-68605@lists.php.net to get a copy of this message | ||
Note Submitter: fab@harlequin.ch
----
If you get a string of an array back from curl_exec you can
use this piece of code to make variables from the array keys:
$ignore = array('Array','(',')','');
$matches = preg_split("/\n/", $CURLresult);
foreach ($matches as $key=>$value) {
$value = trim($value);
if (!(in_array($value,$ignore))) {
$vals = preg_split("/=>/", $value);
$vals[0] = eregi_replace("\[","",$vals[0]);
$param = trim(eregi_replace("\]","",$vals[0]));
#echo $param."<br>";
${$param} = $vals[1];
}
}
Hope this can help you.