forked from jmathai/php-multi-curl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
30 lines (24 loc) · 910 Bytes
/
example.php
File metadata and controls
30 lines (24 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
include './EpiCurl.php';
$mc = EpiCurl::getInstance();
// call yahoo
$ch = curl_init('http://www.yahoo.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$yahoo = $mc->addCurl($ch);
// call google
$ch = curl_init('http://www.google.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$google = $mc->addCurl($ch);
// call ebay and microsoft
$ch = curl_init('http://www.ebay.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ebay = $mc->addCurl($ch);
// fetch response from yahoo and google
echo "The response code from Yahoo! was {$yahoo->code}\n";
echo "The response code from Google was {$google->code}\n";
$ch = curl_init('http://www.microsoft.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$microsoft = $mc->addCurl($ch);
// fetch response from ebay and microsoft
echo "The response code from Ebay was {$ebay->code}\n";
echo "The response code from Microsoft was {$microsoft->code}\n";