Skip to content

Instantly share code, notes, and snippets.

@maximgrynykha
Created September 1, 2020 21:09
Show Gist options
  • Save maximgrynykha/647b29745440e7480436ace252ab359f to your computer and use it in GitHub Desktop.
Save maximgrynykha/647b29745440e7480436ace252ab359f to your computer and use it in GitHub Desktop.
PHP сниппет с форматированием для ведения логов.
$f = fopen("filename.txt", "a+") or die("Connection error!");
fputs($f,
str_repeat("-", 150) . PHP_EOL .
" | Title: " . $news['title'] . PHP_EOL .
" | Description: " . $news['description'] . PHP_EOL .
str_repeat("-", 150) . PHP_EOL . PHP_EOL
);
fclose($f);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment