Skip to content

Instantly share code, notes, and snippets.

@Yanovskiy
Created March 6, 2014 18:11
Show Gist options
  • Save Yanovskiy/9395922 to your computer and use it in GitHub Desktop.
Save Yanovskiy/9395922 to your computer and use it in GitHub Desktop.
Curl to follow redirects
<?php
/**
* @author dweingart at pobox dot com
*
* If you want to Curl to follow redirects
* and you would also like Curl to echo back
* any cookies that are set in the process,
* use this:
*/
curl_setopt($ch, CURLOPT_COOKIEJAR, '-');
// '-' means stdout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment