Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php $timestamps = array(); for ($i = 0; $i < 5000; $i++) { $timestamps[] = mt_rand(strtotime('1900-01-01 00:00:00 am'), strtotime('2100-12-31 11:59:59 pm')); } $mapped = array_map( function($t) { return [strtotime(date('H:i:s', $t)), strtotime(date('Y-m-d h:i:s a', $t))]; }, $timestamps ); $res = array_column($mapped, 1, 0); echo $res[max(array_keys($res))];
Copy Clear