Today I learned:
Basic Logging to CSV in PHP
Here I build the array from the information I get back from Slack (plus a datetime stamp) and pass it to a file called
A note on
fopen() - A lot of tutorials replace that
'a' with a
'w'. According to the docs,
w writes at the beginning of the file, which is why my first couple tries overwrote each other. The
a starts writing at the end of the file, which is always a new line since
fputcsv() always ends with a line break.
I finally found a good solution for syntax highlighting in code blocks with Jekyll: Kramdown with Pygments plugin.
Installation is simple: Clone the project to your
_plugins folder and add it to the Plugins section of your
_config.yaml, then you are ready to go.
Usage is equally as simple: Specify the language at the end of the first line of your code blocks and the plugin will add the proper classes and highlight the code according to the language.
~~~~ php echo "Hello world!"; ~~~~
echo "Hello world!";