-
-
Save devfabriciobr/84c6b0001e00fbd9cd71bd779b96a749 to your computer and use it in GitHub Desktop.
CRIAR ARQUIVO LOG TXT
This file contains hidden or 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
| <?php | |
| # SIMPLIFICADO (SEM BUFFER) | |
| $conteudo = print_r($param, true); | |
| file_put_contents("app/output/log.txt", $conteudo); | |
| # COMPLETO (COM BUFFER) | |
| ob_start(); | |
| var_dump($conteudo); | |
| $retorno = ob_get_clean(); | |
| $arquivo = date('YmdHis').'_'.uniqid().'_log.txt'; | |
| file_put_contents("app/output/{$arquivo}", $retorno.PHP_EOL, FILE_APPEND); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment