Posts Tagged 'curl'

Easy CURL for PHP

Hello all the readers,

This time its about PHP. Yes PHP ! Last project on which i was working on was on PHP. Quite many MySQL in it and quite many web requests. When it came to web requests, the only thing that was in my mind was CURL. That a good to use way to make web requests. As i was working quite after a long time on PHP, didn’t remember much of its library. Went to php.net and searched through the whole libraries and some tutorials to follow to make dummy requests to servers. It was kinda messy. I searched through net to find some wrappers for the CURL in PHP. But ! wasn’t able to find any good OOP based wrapper for CURL in PHP.

Many wrappers were there, and some were really good. But mostly all of them dealt with the underlying curl resource of PHP. Actually that was the problem, remembering all those constants was a pain for me (and i guess for many others). So i thought for a way out of this problem. MAKE MY OWN WRAPPER CLASS.

My goals were quite clear, i have to write such a wrapper that can give the strength of underlying yet be a simple one. So that the pain part can be removed. More over the result should be parsed and fetch in a properties way so that i don’t have to much working on the result to just get out the cookies or headers from it.

Getting inspiration from C# WebRequest class. I tried to create the PHP’s curl class. Please take out your time to view the Examples given with the code. And comment if you like and if you found anything missing or not properly done please report. I would be waiting for the comments.

Thanks.

Link to the Code Repository : Easy CURL for PHP


Tweets From The Author


%d bloggers like this: