Reply to Re: when does it ever make sense to use curl?

Your name:

Reply:


Posted by NC on 05/18/06 18:28

lawrence k wrote:
>
> I'm reading over this page:
>
> http://www.php.net/manual/en/ref.curl.php
>
> What I'm missing is why?

And why not? cURL was not developed for PHP, but why not use it if
it's available?

> What problem does curl solve? What does it make easier?
> When would I use its functions, instead of simpler functions
> like file() or fsocketopen()?

Using fsockopen() is not that simple compared to cURL; you have to keep
track of redirects, cookies, etc., and remember to separate HTTP
headers from the data proper. As to file()/readfile(), PHP sometimes
experiences problems opening dynamically generated remote files via
file system functions, even with allow_url_fopen = On. Sometimes it
even generates error messages like these:

Warning: file([URL]) - Success in file.php on line X
Warning: fopen([URL], 'r') - Undefined error: 0

Cheers,
NC

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация