hi there I designed a blog page....per page 10 artilcs!
I want return biggest time (stamptime) for each 10 articls (like publish up time,publish down time,created,modifed time) to create meta tag.
so I have a list of 10 artiles (each article is an array with all parameters like date,content,title,...) that I saved them in $list array.
like this:
$list = array ( array('id' => '1', 'modifed ' => '123123123' ...
I want return biggest value...the articls are mixed.
I use this code:
$data['created'] = array_reduce($list, function ($a, $b) {
return @$a['created'] > $b['created'] ? $a : $b ;
$data['modified'] = array_reduce($list, function ($a, $b) {
return @$a['modified'] > $b['modified'] ? $a : $b ;
$data['publish_up'] = array_reduce($list, function ($a, $b) {
return @$a['publish_up'] > $b['publish_up'] ? $a : $b ;
$data['publish_down'] = array_reduce($list, function ($a, $b) {
return @$a['publish_down'] > $b['publish_down'] ? $a : $b ;
My only worry is it maybe has a bad effect in my loading page.
do you think this code is Optimized?