Im grabbing a page with below.

$homepage = file_get_contents('http://www.example.com/');
echo $homepage;

How do I write it to a file.txt and overwite in the event the file exists ?

Thanks.

thank you. Yeah I was caught up on file_put_contents. Thanks again.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.