Page 1 of 1

Creating php-string from content of URL

Posted: Sat Jan 23, 2010 6:52 pm
by habiatuq
Hello,
I am new to PHP. I need to store the source code of a webpage (say http://www.iit.edu) in a php string.
In Objective-c, I can do this with a class method: stringWithContentOfURL.
can someone please help me achieve this in php?
cheers,

Re: Creating php-string from content of URL

Posted: Sat Jan 23, 2010 7:18 pm
by AbraCadaver
habiatuq wrote:Hello,
I am new to PHP. I need to store the source code of a webpage (say http://www.iit.edu) in a php string.
In Objective-c, I can do this with a class method: stringWithContentOfURL.
can someone please help me achieve this in php?
cheers,
As long as your PHP installation allows you to use URLs (allow_url_fopen = On), then use: file_get_contents()