当前位置: 首页>>代码示例>>PHP>>正文


PHP Carbon::diffInDays方法代码示例

本文整理汇总了PHP中Carbon::diffInDays方法的典型用法代码示例。如果您正苦于以下问题:PHP Carbon::diffInDays方法的具体用法?PHP Carbon::diffInDays怎么用?PHP Carbon::diffInDays使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Carbon的用法示例。


在下文中一共展示了Carbon::diffInDays方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Carbon

<?
/**
* TITLE: Главная страница
* AVAILABLE_ONLY_IN_ADVANCED_MODE
*/
?>
<?php 
$created = new Carbon(Config::get('site.date_over_action'));
$now = Carbon::now();
$difference = $created->diff($now)->days < 1 ? 'Сегодня заканчивается регистрация в конкурсе.' : 'До окончания регистрации в конкурсе осталось ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '.';
$created = new Carbon(Config::get('site.date_final_action'));
$now = Carbon::now();
$difference_final = $created->diff($now)->days < 1 ? 'Сегодня шоу-финал.' : 'До шоу-финала остается ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '. Зарегистрируйся на сайте и покажи свой талант всем!';
$map = array();
if (isset($page->blocks['map']['meta']['content']) && !empty($page->blocks['map']['meta']['content'])) {
    $map = json_decode($page->blocks['map']['meta']['content'], TRUE);
}
$participants = Accounts::where('group_id', 4)->where('in_main_page', 1)->with('ulogin', 'likes')->take(15)->get();
foreach ($participants as $index => $participant) {
    $participants[$index]['like_disabled'] = FALSE;
}
if (isset($_COOKIE['votes_list'])) {
    $users_ids = json_decode($_COOKIE['votes_list']);
    foreach ($participants as $index => $participant) {
        if (in_array($participant->id, $users_ids)) {
            $participants[$index]['like_disabled'] = TRUE;
        }
    }
}
?>
@extends(Helper::layout())
开发者ID:Grapheme,项目名称:amway,代码行数:31,代码来源:index.blade.php

示例2: Carbon

<?
/**
 * TITLE: О проекте
 * AVAILABLE_ONLY_IN_ADVANCED_MODE
 */
?>
<?php 
$created = new Carbon(Config::get('site.date_over_action'));
$now = Carbon::now();
$difference = $created->diff($now)->days < 1 ? 'Сегодня заканчивается регистраця в конкурсе.' : 'До окончания регистрации в конкурсе осталось ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '.';
$steps = array();
if (isset($page['blocks']['etap_1'])) {
    if (isset($page['blocks']['etap_1']['meta']['content']) && !empty($page['blocks']['etap_1']['meta']['content'])) {
        $steps['etap_1'] = json_decode($page['blocks']['etap_1']['meta']['content'], TRUE);
    }
}
if (isset($page['blocks']['etap_2'])) {
    if (isset($page['blocks']['etap_2']['meta']['content']) && !empty($page['blocks']['etap_2']['meta']['content'])) {
        $steps['etap_2'] = json_decode($page['blocks']['etap_2']['meta']['content'], TRUE);
    }
}
if (isset($page['blocks']['etap_3'])) {
    if (isset($page['blocks']['etap_3']['meta']['content']) && !empty($page['blocks']['etap_3']['meta']['content'])) {
        $steps['etap_3'] = json_decode($page['blocks']['etap_3']['meta']['content'], TRUE);
    }
}
$nominations = array();
if (isset($page['blocks']['nom_1'])) {
    if (isset($page['blocks']['nom_1']['meta']['content']) && !empty($page['blocks']['nom_1']['meta']['content'])) {
        $nominations['nom_1'] = json_decode($page['blocks']['nom_1']['meta']['content'], TRUE);
    }
开发者ID:Grapheme,项目名称:amway,代码行数:31,代码来源:about.blade.php


注:本文中的Carbon::diffInDays方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。