Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $urls = array(
- 'pouet.net',
- 'www.pouet.net',
- 'lemonde.fr',
- 'www.lemonde.fr',
- 'pastebin.com',
- 'www.pastebin.com',
- 'curl.haxx.se',
- 'www.curl.haxx.se',
- 'google.com',
- 'www.google.com'
- );
- foreach ($urls as $source) {
- $req = curl_init();
- $options = array(
- CURLOPT_FAILONERROR => true,
- CURLOPT_FOLLOWLOCATION => true,
- CURLOPT_HEADER => true,
- CURLOPT_NOBODY => true,
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_URL => $source,
- );
- curl_setopt_array($req, $options);
- if ($res = curl_exec($req)) {
- echo $source . ' → ' . curl_getinfo($req, CURLINFO_EFFECTIVE_URL);
- curl_close($req);
- } else {
- echo $source . ' → ' . 'failed';
- }
- echo "\n\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement