From a43d3a4e10d22e68b6d01a02ed48364d4a11ff4c Mon Sep 17 00:00:00 2001 From: "T. Todua" <7117978+ttodua@users.noreply.github.com> Date: Thu, 27 May 2021 17:57:29 +0400 Subject: [PATCH] Update README.md It is important to let people know that there is also Request argument passed. Also, in some cases, it is very important to have associative array and determining keys in callback. Please amend to address them. I have added also example. also, please make a small addition in readme, to describe what is "group" class in the repo, as i found no usage examples. Thanks for nice work. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d84641..db9eae2 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ $urls = array("http://www.google.com", "http://www.yahoo.com"); // a function that will process the returned responses -function request_callback($response, $info) { +function request_callback($response, $info, $request) { // parse the page title out of the returned HTML if (preg_match("~(.*?)~i", $response, $out)) { @@ -39,6 +39,7 @@ function request_callback($response, $info) { echo "$title
"; print_r($info); + print_r($request); echo "
"; } @@ -58,7 +59,7 @@ foreach ($urls as $url) { $rc->execute(); ``` - +(Note, if you have an associative array of urls, and in the callback you want to determine which key was the holder of the currently executed url, then you can use [such example](https://pastebin.com/raw/q4iP8jkG) ) ###Example 2 - Setting custom options: