RawSushi's Tech Journal
My online tech scrapbook where I keep my notes in case I need to look them up later
Friday, June 1, 2012
Simple Way to Make HTTP Request With PHP
PHP is surprisingly lacking in built-in HTTP Request capabilities. To enable this, external libraries or modules are needed.
However, one simple way to do this if only GET requests are needed is this:
$content = file_get_contents("
http://www.google.co
m
");
It's simple, doesn't even follow redirects, but gets the job done if your needs are simple.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment