Answer the question
In order to leave comments, you need to log in
How to insert a response from one script into another?
There is a script:
<?php
include_once 'MultiCurl.class.php'
$poolSize = 10;
$requests = array(
array('url' => 'https://www.google.com/search?q=0'),
array('url' => 'https://www.google.com/search?q=1'),
array('url' => 'https://www.google.com/search?q=2'),
array('url' => 'https://www.google.com/search?q=3'),
array('url' => 'https://www.google.com/search?q=4'),
array('url' => 'https://www.google.com/search?q=5'),
array('url' => 'https://www.google.com/search?q=6'),
array('url' => 'https://www.google.com/search?q=7'),
array('url' => 'https://www.google.com/search?q=8'),
array('url' => 'https://www.google.com/search?q=9'),
array('url' => 'https://www.google.com/search?q=10'),
);
$startTime = round(microtime(true) * 1000);
$example1 = new MultiCurl($poolSize);
$results = $example1->processRequests($requests);
$endTime = round(microtime(true) * 1000);
echo (count($results) . ' requests were done in ' . ($endTime - $startTime) . ' ms <br/>');
echo 'results: <br/>';
foreach ($results as $key => $value) {
echo $value['url'] . ': ' . $value['status'] . ', content length ' . strlen($value['response']) . ')<br/>';
}
unset($poolSize, $example1, $requests, $results);
?>
<?php
$connect = mysql_pconnect("localhost", "sssss","ssssss");
$select = mysql_select_db("ssssss", $connect);
$sql = mysql_query("SELECT * FROM `ssssss`");
echo '$requests = array(';
while ($return = mysql_fetch_array($sql)) {
echo "array('url' => 'https://www.google.com/search?access_token=".$return["token"]."'),";
} echo ');';
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question