News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ask About PHP:
PHP Basics Accessing Remote URLs using cURL
June 22, 2009 @ 12:06:00

In this new post to the Ask About PHP blog they take a look at one of the basics of using PHP - fetching the data from a remote URL via the cURL extension.

In PHP, there are actually four ways to access a remote URL - fopen() fsockopen(), cURL extensions and HTTP_Request class from the PEAR library. Now, choosing one way over another really depends on your needs for simplicity, control, and portability. Generally, I prefer using cURL simply because it's easy to understand and it's really powerful.

You'll need to have cURL enabled to be able to follow along. The examples show how to fetch a single remote page, a protected remote page, sending a POST request and fetching the URL with custom headers.

0 comments voice your opinion now!
extension curl url remote access


blog comments powered by Disqus

Similar Posts

phpRiot.com: Shortening URLs for goo.gl with Google's URL Shortener API

Luc de Brouwer's Blog: Never having to use $_GET or $_POST again

Sebastian Bergmann's Blog: Support for BDD and Stories in PHPUnit 3.3

Andrei Zmievski's Blog: pecl/memcached turns 1

PHP.net: Update to PHP 5.2.6 Release (XSL & IMAP)


Community Events





Don't see your event here?
Let us know!


api developer code configure release threedevsandamaybe community language laravel bugfix library interview application introduction list framework podcast series wordpress project

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework