Created
July 13, 2011 14:27
-
-
Save habibillah/1080393 to your computer and use it in GitHub Desktop.
very-very simple way to wite file in PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function writeDataTofile($data=null) { | |
$upload_path = APP . 'tmp' . DS . 'logs' . DS . 'trace.log'; | |
$fp = fopen($upload_path,'w'); | |
if (is_array($data)) { | |
foreach ($data as $key=>$value) { | |
fwrite($fp, $key . ": " . $value . "\n\r"); | |
} | |
} else { | |
fwrite($fp, $key . ": " . $value . "\n\r"); | |
} | |
fclose($fp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment