snowman15 Posted May 7, 2008 Share Posted May 7, 2008 Can anybody direct me or post a simple curl tutorial that goes out on to a webpage and saves the source as a txt file or something. Anything really, i just need to be able to use sting manipulation to look for certain values. example: using curl to look for stock market price. Link to comment https://forums.phpfreaks.com/topic/104591-simple-curl-tutorial/ Share on other sites More sharing options...
rhodesa Posted May 7, 2008 Share Posted May 7, 2008 If you just want the source of a page, you can use any of the file functions, like file_get_contents() but to do it with cURL: <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.example.com/"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $source = curl_exec($ch); curl_close($ch); ?> Link to comment https://forums.phpfreaks.com/topic/104591-simple-curl-tutorial/#findComment-535378 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.