Tag: php.ini

How to configure cURL in xampp server

xampp server with default configuration can’nt run curl_init(); to make it work in xampp server we have to edit three files namely 1. php.ini(which is a configuration stting file). 2. php.ini-recommended(INI-DIST file) 3. php.ini-dist(INI-RECOMMENDED file) open these files in notepad

Tagged with: , , , , ,

How to call url from php using C-url :: alternative to file_get_contents()

This is a nice and simple substitute to get_file_contents() using curl, it returns FALSE if $contents is empty. <?php function curl_get_file_contents($URL) { $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_URL, $URL); $contents = curl_exec($c); curl_close($c); if ($contents) return $contents; else

Tagged with: , , , , , , , , , ,