How to Use the Ls Command on Linux or Mac OS X to Sort Files based on Second in the Timestamp
Here is the one liner.
ls -lhtTr
It will output something like
total 24152
-rw-rw-r-- 1 sean staff 1.0M May 4 14:31:42 2019 4c2caf52cb084ea39a6a65a0e68ee382
-rw-rw-r-- 1 sean staff 1.0M May 4 14:31:44 2019 76eeeea5d...
Written by Sean Behan on 05/04/2019
How to Use the Ls Command on Linux or Mac OS X to Sort Files based on Second in the Timestamp
Here is the one liner.
ls -lhtTr
It will output something like
total 24152
-rw-rw-r-- 1 sean staff 1.0M May 4 14:31:42 2019 4c2caf52cb084ea39a6a65a0e68ee382
-rw-rw-r-- 1 sean staff 1.0M May 4 14:31:44 2019 76eeeea5d...
Written by Sean Behan on 05/04/2019
How to Flatten and Merge Arrays in PHP
There is no built in function for taking a multi dimensional array in PHP and flattening it into a single array. However, it's pretty easy to accomplish in a one liner. Here is the code
...
Written by Sean Behan on 09/28/2018
XPath with HTML in PHP One Liner
Here is a one liner for using XPATH with HTML in PHP
$doc = new DOMXPath(@DOMDocument::loadHTML(file_get_contents("https://www.reddit.com/r/PHP/")));
Now you can use XPATH to query the html..
foreach($doc->query("//a") as $el){
echo $el->no...
Written by Sean Behan on 11/14/2017