file_get_contents
file_get_contents
Using Authentication And file_get_contents()
Mon, 02/15/2010 - 23:00 | by philipnorton42Using file_get_contents() to fetch the contents of a file is quite a common practice. This might be just to get the contents of a text file or to get the ImageCache module in Drupal to pre-cache images. The file_get_contents() function can get a local or remote file and is usually run like this.
$data = file_get_contents($url);
However, when trying to use this function to communicate with an authenticated server you will see the following error appearing.
PHP Function To Get TinyURL
Fri, 06/05/2009 - 10:02 | by philipnorton42TinyURL is a service where you can convert a long URL string to a really small one. For instance, the following URL, which points to the Googleplex on Google Maps.
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=googleplex&sll=37.579413,-95.712891&sspn=34.512672,45.615234&ie=UTF8&cd=1&z=16
Can be converted to the following.