I currently have a blacklist.php file that generates a black list and I need a blacklist.txt file on Linux that pulls the output from the PHP file.
Is this possible?
The file_get_contents function takes the name of the php file and reads the contents of the text file and displays it on the console. get the contents, and echo it out. <? php echo file_get_contents( "filename.
Open Terminal using Ctrl + Alt + T , now type sudo -H gedit , then type your password and press enter . This will open the gEdit program with root permission. Now open your . php file where it's located or just drag the file into gEdit.
The simplest way to view text files in Linux is the cat command. It displays the complete contents in the command line without using inputs to scroll through it.
If your blacklist.php writes output to standard output, you can run your PHP script like this
php blacklist.php > blacklist.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With