02-01-2011, 08:22 AM | #1 |
Administrator
Join Date: Jul 2010
Posts: 402
Rep Power: 10 |
PHP Writing Text To A File
There are many times you need to write text to a file. Unfortunately when you search google you usually find examples are that use fwrite, fopen, etc.. They are fine grained sure, but most of the time you only need quick and dirty file writing. There is a built in PHP function that lets you write to a file in just one line:
Code:
file_put_contents($file, $data, FILE_APPEND | LOCK_EX); Enjoy! Less code is more! |
Reply With Quote |
Reply |
Tags |
other php
,
php examples
,
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
My favorite text editor for PHP | Jeff | PHP | 3 | 06-22-2011 07:04 AM |