2

I have listed code:

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();
}

But I have problem with printing content of variable. How can I print it in needed place?

1 Answers1

1

I think this is what you need

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

More info here.

Community
  • 1
  • 1
Vlad Preda
  • 9,780
  • 7
  • 36
  • 63