Curl Tutorials

Download File from URL

Download File from URL




In this tutorial I will explain you how to download file from URL. We two methods to get content from external URL’s, file_get_contents and CURL. Using file_get_contents : This function reads entire file into a string. But this function only works when fopen is enabled. Using CURL : CURL supports http, https, ftp, file protocols and more. Mostly enabled on all server these days. If you are using https url …

Continue reading




Download File From Remote Server in PHP

Download File From Remote Server in PHP




There are many methods in PHP that helps to download file from remote server. We can use php functions like file_get_content, copy, fsockopen and fopen to download remote files. But in this post I will use curl to download file. Because it is the advanced way to work with remote resources it can download large files with minimum memory uses. Before download a file we need to find if file …

Continue reading




YouTube Video Information Using YouTube API

YouTube Video Information Using YouTube API




If you want to embed YouTube videos or want to add your video gallery then you can use YouTube API v2 to get all necessary information about the video like video title, description, category, thumbnail and others. In this post I am going to show you how to get YouTube video information using YouTube api. To get the YouTube video information in JSON format we will use CURL and pass …

Continue reading




Get geolocation from ip in PHP

Get geolocation from ip address




In PHP, there is no direct way to get geolocation of an IP address. Therefore we have to use third party API to get geolocation from ip address. There are many paid and free APIs available to get geolocation from ip address. I found a very simple and easy api freegeoip.net. It is a public RESTful web service API for searching geolocation of IP addresses and host names. freegeoip.net API …

Continue reading