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.
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...
Reading from stdin in PHP is just like reading a file. The only difference is that the file to read is called php://stdin
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...
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).
In PHP the program arguments of current script is always available in the $argv variable except when it is not.