2

我列出了代码:

class myClass {

public $url;
public $content;
public $ip;

public function analysis()
{       
    $list = array('http://site.ru?url=http://'.urlencode($this->url) => 'get_tcy');

    function request_callback($response, $info, $request)
    {
        //at this place I need print content of $list variable
    }

    $rc = new RollingCurl("request_callback");
    foreach ($list as $key => $value) 
    {
        $request = new RollingCurlRequest($key);
        $rc->add($request);
    }
    $rc->execute();
}

但我在打印变量内容时遇到问题。如何在需要的地方打印?

4

1 回答 1

1

我认为这就是你需要的

$fn = function ($response, $info, $request) use ($list) {
    var_dump($list);
};
$rc = new RollingCurl($fn);

更多信息在这里

于 2013-09-04T19:07:27.963 回答