I have file 123.php which produces dynamic information upon excecution and need 123.php to copy it's output to file "abc.txt" How would I go about this in a unix environment?

Thanks in Advance!

Recommended Answers

All 3 Replies

fopen, fwrite, fclose or even simpler, file_put_contents.

Member Avatar for diafol

fopen, fwrite, fclose or even simpler, file_put_contents.

Ditto:

looks at this - amazing!

Below is what ended up working for me on my BSD box!

<?php
$fileHandle = fopen('/usr/local/myface/youtweet.txt', 'w+')
 OR die ("Can't open file\n");

$faceit = "got to love myfaceyoutweet.com";

fwrite ($fileHandle, $faceit);

fclose ($fileHandle);//CLOSE FOPEN 
?>
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.