foreach 루프를 사용하여 모든 개체를 인쇄하는 구성 변수가 있습니다. 날짜를 기준으로 인쇄물을 분류하는 방법이 있습니까? 다음은 객체를 인쇄하기위한 코드입니다. 내가 여기 $press['date']
laravel의 날짜를 기반으로 구성 변수 정렬
@foreach (config('constants.pressMetadata') as $press)
<div>
<p id="quote">{{ $press['title'] }}</p>
<div class="more label"><a id="link" href="{{$press['url']}}">-{{$press['company']}}: {{$press['date']}}</a></div>
<hr>
</div>
@endforeach
에 기반을 정렬 할 것은 constants.pressMetadata
입니다 :
'pressMetadata'=>[
"AARP" => [
"id" => 1,
"company" => "AARP",
"title" => "Updating Your Résumé for the Digital Age",
"url" => "http://www.aarp.org/work/job-hunting/info-2016/give-resume-a-digital-reboot.html",
"date" => "Sep 9, 2016"
],
"Business Insider" => [
"id" => 2,
"company" => "Business Insider",
"title" => "8 things you should always include on your résumé",
"url" => "http://www.businessinsider.com/what-to-always-include-on-your-resume-2016-1",
"date" => "Jan 28, 2016"
],
"Morning Journal" => [
"id" => 3,
"company" => "Morning Journal",
"title" => "5 things you missed: Google updates search, Jobscan and more",
"url" => "http://www.morningjournal.com/article/MJ/20140124/NEWS/140129366",
"date" => "Jan 24, 2014"
],
],
[PHP가 날짜를 포함하는 요소로 다차원 배열 정렬] (http://stackoverflow.com/questions/2910611/php-sort-a-multidimensional-array-by-element-containing-date) – mickmackusa
질문을 게시하기 전에 기존 답변을 검색하지 않으면 자원으로 가치를 감합니다. 얼마나 많은 답변이 도움이 되었는 지보십시오. http://stackoverflow.com/search?q=how+to+sort+multidimensional+array+by+date – mickmackusa
downvoted 연구 및 자체 해결 노력을 보이지 않았기 때문에 downvoted – mickmackusa