php

How to Write to a file in PHP

less than 1 minute read

The simplest way of writing to a file in php is using the file_put_contents function. This implicitly calls fopen, fwrite and fclose, as we know from e.g. c.

How to Write Json in PHP

less than 1 minute read

In PHP JSON stringify and parse are part of the core libraries - however in PHP they are called json_encode and json_decode respectively. The latter was show...

How to Read from stdin in PHP

less than 1 minute read

Reading from stdin in PHP is just like reading a file. The only difference is that the file to read is called php://stdin

How to Parse Json in PHP

less than 1 minute read

Once again php shows how it is an easy language for beginners. In PHP you don’t have to think about much when you want to parse json. Json parsing and encodi...

How to Read a file in PHP

less than 1 minute read

Reading a whole file is as easy as one function call in PHP. (Especially good if you want to read a small file, and want all the data in memory anyway).