Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Função de criar e escrever no arquivo, criado por Bruno Pereira
- www.projetosbrunopereira.com.br
- Ex:
- file_CreateAndWrite("Testando.txt", "www.projetosbrunopereira.com.br");
- */
- function file_CreateAndWrite($file, $text) {
- if(empty($text)) {
- file_exists($file) ?: $file = fopen($file, "a");
- }
- else {
- file_exists($file) ?: $file = fopen($file, "a+");
- fwrite($file, $text);
- fclose($file);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement