How to get file system errno on Linux
error-handling, php
Solution
The results can be kind of ambiguous, but the closest equivalent to `errno` in PHP is the `error_get_last` function.
Problem
I see that `file_put_contents` function is returning `FALSE` but is it possible to know the error (`errno`) returned from the system call from Linux kernel? There could be many reasons for failure (which could even be device or driver dependent). So I want to know the exact error reason. `file_put_contents` simply returns `FALSE` on failure. What I want would be equivalent to C `errno` or the `perror` C function.