本文整理汇总了PHP中month函数的典型用法代码示例。如果您正苦于以下问题:PHP month函数的具体用法?PHP month怎么用?PHP month使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了month函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: day
function day($date)
{
$change = gmdate($date, time() + 60 * 60 * 8);
$split = explode("-", $change, 3);
$date = $split[2];
$month = month($split[1]);
$year = $split[0];
return $date . ' ' . $month . ' ' . $year;
}
示例2: __construct
public function __construct(array $time)
{
$this->year = array_key_exists('year', $time) ? intval($time['year']) : 0;
$this->month = array_key_exists('month', $time) ? intval(month($time['month'])) : 0;
$this->day = array_key_exists('day', $time) ? intval($time['day']) : 0;
$this->startTime = intval($time['startTime']);
$this->endTime = intval($time['endTime']);
$this->wkDay = intval(week($time['wkDay']));
$this->wkRepeat = array(FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
}
示例3: uploading
function uploading()
{
$new_name = 'Import_sbu_all_' . date('d') . ' ' . month(date('m')) . ' ' . date('Y');
$config['upload_path'] = './upload/';
$config['allowed_types'] = 'xls|xlsx';
$config['file_name'] = $new_name;
$this->load->library('upload', $config);
//uploading file to directory upload
if (!$this->upload->do_upload()) {
$error = array('error' => $this->upload->display_errors());
$data = array("title" => "SPJ | Import", "judul" => "Import Data Error");
redirect('import', $error);
} else {
$res = array('upload_data' => $this->upload->data());
$filename = $res['upload_data']['file_name'];
$file_ext = $res['upload_data']['file_ext'];
//print_r($this->upload->data());
// application/vnd.ms-excel xls
// application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
if ($file_ext == ".xls") {
$objReader = PHPExcel_IOFactory::createReader('Excel5');
} else {
if ($file_ext == ".xlsx") {
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
} else {
if ($file_ext == ".ods") {
$objReader = PHPExcel_IOFactory::createReader('OOCalc');
} else {
redirect('home', 'refresh');
}
}
}
$uploadpath = "./upload/" . $filename;
$objReader->setReadDataOnly(TRUE);
$objPHPExcel = $objReader->load($uploadpath);
$this->showXls();
/**$data = array("title"=>"SDPPI | Import SBU",
"judul"=>"Import Telah Sukses",
"file"=>$this->input->post($filename));
$this->load->view('header',$data);
$this->load->view('main',$data);
$this->load->view('v_xls',$data);
$this->load->view('footer',$data);**/
}
}
示例4: ucfirst
<p> <?php
echo '' . ucfirst(strtolower($name_search));
?>
contains <?php
echo '' . $subcat;
?>
subgroups and was <?php
echo '' . $cpi_basket_value . '% of the ' . month($start, 5, 2) . '-' . year($start, 0, 4) . ' CPI Basket.';
?>
<p><?php
echo '' . $msg_rose . 'in ' . month($end, 5, 2) . '-' . year($end, 0, 4) . $msg_higher . month($start, 5, 2) . '-' . year($start, 0, 4);
?>
<?php
} else {
$sql_sub = "SELECT name_subgroup FROM cpi_subgroup,cpi_class WHERE cpi_class.id_subgroup=cpi_subgroup.id_subgroup and `id_" . $table_search . "`='" . $byDefaut . "'";
$sql_sub = mysql_query($sql_sub);
$psub = '';
while ($row = mysql_fetch_array($sql_sub)) {
$psub = $row['name_subgroup'];
}
echo '<p>' . ucfirst(strtolower($name_search)) . ' is a class of ' . $psub . ' and represents ' . $cpi_basket_value . '% of the ' . month($start, 5, 2) . '-' . year($start, 0, 4) . ' CPI Basket.';
echo '<p>' . $msg_rose . 'in ' . month($end, 5, 2) . '-' . year($end, 0, 4) . $msg_higher . month($start, 5, 2) . '-' . year($start, 0, 4);
}
}
?>
<div id="container1" class="col-xs-6 col-md-6">
</div>
示例5: testSelect_date
function testSelect_date()
{
$expect = array();
$expect[] = "[ \n]+<select name=\"fubar_day\" size=\"0\">";
for ($idx = 1; $idx < 32; $idx++) {
$expect[] = "[ \n]+<option value=\"" . $idx . "\">" . $idx;
}
$expect[] = "[ \n]+<\\/select>";
$expect[] = "[ \n]+<select name=\"fubar_month\" size=\"0\">";
for ($idx = 1; $idx < 13; $idx++) {
$expect[] = "[ \n]+<option value=\"" . $idx . "\">" . month($idx);
}
$expect[] = "[ \n]+<\\/select>";
$expect[] = "[ \n]+<select name=\"fubar_year\" size=\"0\">";
for ($idx = 2001; $idx <= 2005; $idx++) {
$expect[] = "[ \n]+<option value=\"" . $idx . "\">" . $idx;
}
$expect[] = "[ \n]+<\\/select>[ \n]+";
$this->set_text(select_date("fubar", "-1", "-1", "-1"));
$this->_testFor_pattern(implode("", $expect));
$this->_testFor_string_length(1597);
}
示例6: header
<?php
if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
header("HTTP/1.1 404 Not Found");
exit;
}
global $url_situs;
ob_start();
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
include "mod/statistik/counter.php";
include "mod/statistik/online.php";
include "mod/statistik/hits.php";
include "mod/statistik/useronline.php";
echo '
<tr><td><img src="' . $url_situs . '/mod/statistik/images/visitor.png" alt="Visitors"/></td><td>Visitors</td><td>:</td><td><b>' . $theCount . '</b></td></tr>
<tr><td><img src="' . $url_situs . '/mod/statistik/images/hits.png" alt="Hits"/></td><td>Hits</td><td>:</td><td><b>' . $hits . '</b></td></tr>
<tr><td><img src="' . $url_situs . '/mod/statistik/images/month.png" alt="Month"/></td><td>Month</td><td>:</td><td><b>' . month() . '</b></td></tr>
<tr><td><img src="' . $url_situs . '/mod/statistik/images/today.png" alt="Today"/></td><td>Today</td><td>:</td><td><b>' . day() . '</b></td></tr>
</table>';
$out = ob_get_contents();
ob_end_clean();
示例7: other
public function other()
{
$Other = M('AssetOther');
$this->assign('table', $Other->select());
//其他列表
$select = M('OtherSelect');
$othername = $select->field('name,count(name)')->group('name')->select();
$this->assign('othername', $othername);
//其他名称
$unit = M('AssetUnit');
$assetunit = $unit->select();
$this->assign('assetunit', $assetunit);
//其他单位
$otherstate = $Other->field('names,unit,count(names) as numberall ')->group('names,unit')->select();
$this->assign('otherstate', $otherstate);
//现有其他的数量
// $nowtime = strtotime()
// $mintime = $Other->field('start')->order('start')->find();
$maxtime = $Other->field('start')->order('start desc')->find();
$m = month(strtotime($maxtime['start']));
$othertime = array();
$timenum = 0;
foreach ($m as $item) {
$map['start'] = array('like', $item . '%');
$othershow = $Other->where($map)->field('start,count(number) as num')->select();
$othershow[0]['start'] = $item;
array_push($othertime, $othershow[0]);
$timenum++;
}
$this->assign('othertime', $othertime);
if ($othertime[0]['num'] == 0) {
$this->assign('color', 'bg-red-gradient');
} else {
$subnum = $othertime[0]['num'] - $othertime[$timenum]['num'];
if ($subnum > 0) {
$this->assign('color', 'bg-green-gradient');
} else {
$this->assign('color', 'bg-yellow-gradient');
}
}
$this->display();
}
示例8: mysql_query
$sql_query = "select distinct time_cpi_group from cpi_data_group order by time_cpi_group";
$date_query = mysql_query($sql_query) or die(mysql_error());
$count = mysql_num_rows($date_query);
$last = '';
if ($count > 0) {
// $selected = $count - 1;
// $i = 0;
$optgroup = "2009";
echo '<optgroup label=' . $optgroup . '>';
while ($row = mysql_fetch_array($date_query)) {
$period = $row['time_cpi_group'];
if ($optgroup !== year($period, 0, 4)) {
$optgroup = year($period, 0, 4);
echo '<optgroup label=' . $optgroup . '>';
} else {
$last = month($period, 5, 2, 0);
if ($period === $ending) {
echo '<option value=' . $period . ' selected="selected"> ' . $last . ' ' . year($period, 2, 2) . ' </option>';
} else {
echo '<option value=' . $period . '> ' . $last . ' ' . year($period, 2, 2) . ' </option>';
}
if ($last === 'Dec') {
echo '</optgroup>';
}
}
// $i++;
}
if ($last !== '12') {
echo '</optgroup>';
}
}
示例9: month
<dt>Civil Status</dt>
<dd>
<select name="strCivilStatus" class="selectpicker" data-live-search="false">
<option value="">-- Select Status --</option>
<option value="single">Single</option>
<option value="married">Married</option>
<option value="separated">Separated</option>
<option value="widowed">Widowed</option>
</select>
</dd>
<dt>Birthday</dt>
<dd>
<select name="strMonth" class="span2 selectpicker" data-live-search="true">
<option value="">-- Month --</option>
<?php
$month = month();
for ($x = 1; $x <= 12; $x++) {
echo '<option value="' . $month[$x] . '">' . $month[$x] . '</option>';
}
?>
</select>
<select name="strDays" class="span2 selectpicker" data-live-search="true">
<option value="">-- Day --</option>
<?php
$day = day();
for ($x = 1; $x <= 31; $x++) {
echo '<option value="' . $day[$x] . '">' . $day[$x] . '</option>';
}
?>
</select>
<select name="strYear" class="span2 selectpicker" data-live-search="true">
示例10: header
<?php
if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
header("HTTP/1.1 404 Not Found");
exit;
}
ob_start();
/*
echo '<div style="text-align:center;"><!-- Histats.com START -->
<script type="text/javascript" >
var s_sid = 508946; var st_dominio = 4;
var cimg = 30; var cwi =130; var che =80;
</script>
<script type="text/javascript" language="javascript" src="http://s10.histats.com/js9.js"></script>
<noscript><p>
<img src="http://s4.histats.com/stats/0.gif?508946&1" alt="cool hit counter" /></p>
</noscript>
<!-- Histats.com END --></div>';
*/
echo "<table><tr><td>";
include "mod/statistik/counter.php";
include "mod/statistik/online.php";
include "mod/statistik/hits.php";
include "mod/statistik/useronline.php";
echo "\n<img src=\"{url}/images/8.gif\" border=\"0\" alt=\"\" /> Visitors :<b>{$theCount}</b> Users<br />\n<img src=\"{url}/images/9.gif\" border=\"0\" alt=\"\" /> Hits : <b>{$hits}</b> hits<br />\n<img src=\"{url}/images/10.gif\" border=\"0\" alt=\"\" /> Month : <b>" . month() . "</b> Users<br />\n<img src=\"{url}/images/8.gif\" border=\"0\" alt=\"\" /> Today : <b>" . day() . "</b> Users<br />\n<img src=\"{url}/images/9.gif\" border=\"0\" alt=\"\" /> Online : <b>" . useronline() . "</b> Member\n</td></tr></table><br />";
$out = ob_get_contents();
ob_end_clean();
示例11:
?>
</option>
<?php
}
?>
</select>年
<select name="month">
<option value="">--</option>
<?php
for ($i = 1; $i <= 12; $i++) {
?>
<option value="<?php
echo $i;
?>
" <?php
if ($i == month($result[0]['birthday'])) {
echo "selected";
}
?>
><?php
echo $i;
?>
</option>
<?php
}
?>
</select>月
<select name="day">
<option value="">--</option>
<?php
for ($i = 1; $i <= 31; $i++) {
示例12: month
$inWord = '09';
break;
case 'Oct':
$inWord = '10';
break;
case 'Nov':
$inWord = '11';
break;
case 'Dec':
$inWord = '12';
break;
}
return $inWord;
}
$ukwezi = $_POST[month];
$umuba = month($ukwezi);
echo $time = $_POST[year] . '-' . $umuba . '-01' . ' 00:00:00';
$CSVfp = fopen($path, 'r');
if ($CSVfp !== FALSE) {
while (!feof($CSVfp)) {
$data = fgetcsv($CSVfp, 100000, ",");
// $row = str_getcsv($path, "\n");
$tablefro = $data[3];
if ($data[0] != '' and $data[0] != 'CODE') {
$sd = "INSERT INTO cpi_data_" . $tablefro . " (`id_" . $tablefro . "`, `weight`, `cpi_" . $tablefro . "_value`, `time_cpi_" . $tablefro . "`, `index_cpi_" . $tablefro . "`, `area`) VALUES ('" . $data[0] . "', '0', '" . $data[2] . "', '{$time}', '0', 'URBAN')";
$inte = mysql_query($sd);
}
}
mysql_query("UPDATE `nisr_cpi`.`cpi_file_track` SET `status` = 'Saved' WHERE `cpi_file_track`.`id_file` ='{$id}'");
}
}
示例13: foreach
<div class="eventList">';
foreach ($pageposts as $post) {
setup_postdata($post);
$eventTitle = get_field('title');
$image = wp_get_attachment_image_src(get_field('image'), 'eventsFull');
$imageAlt = get_field('image_alt');
$link = get_field('link');
$startDate = get_field('start_date');
$endDate = get_field('end_date');
$target = get_field('target');
$monthStartDateInt = intval(substr(get_field('start_date'), -5, 2));
$monthStartDateName = month($monthStartDateInt);
$dayStartDateInt = intval(substr(get_field('start_date'), -2, 2));
$yearStartDateInt = intval(substr(get_field('start_date'), -10, 4));
$monthEndDateInt = intval(substr(get_field('end_date'), -5, 2));
$monthEndDateName = month($monthEndDateInt);
$dayEndDateInt = intval(substr(get_field('end_date'), -2, 2));
$yearEndDateInt = intval(substr(get_field('end_date'), -10, 4));
//echo 'CurMonth = '.
$monthEndDateInt . ' LastMonth = ' . $lastEventMonthInt;
if ($dayStartDateInt == $dayEndDateInt) {
$date = $dayStartDateInt;
} else {
$date = $dayStartDateInt . ' - ' . $dayEndDateInt;
}
if ($monthEndDateInt != $lastEventMonthInt) {
if ($monthEndDateInt > $lastEventMonthInt && $bluediv || $lastEventMonthInt == 12 && $monthEndDateInt == 1) {
echo '
</ul>
</div>';
}
示例14: datetime_string
function datetime_string($datetime, $time)
{
// $datetime - дата время, $time = 'yes / <любое значение > ' выводить / не выводить время
$y = substr($datetime, 0, 4);
$m = month(substr($datetime, 5, 2));
$d = substr($datetime, 8, 2);
if ($d[0] == '0') {
$d = substr($datetime, 9, 1);
}
if ($time == 'yes') {
$stringtime = substr($datetime, 11, 8);
} else {
$stringtime = '';
}
$data = $d . ' ' . $m . ' ' . $y . ' г. ' . $stringtime;
return $data;
}
示例15: get_end
function get_end($local_func)
{
switch ($local_func) {
case 1:
// Today
// Today
case 2:
// Yesterday+
// Yesterday+
case 3:
// This week
// This week
case 5:
// Last week+
// Last week+
case 6:
// This month
// This month
case 8:
// This year
return mysql_format_date(mktime(23, 59, 59, month(), day(), year()));
// m, d, y -- date ('D, M j',
// return mysql_format_date(now()); // m, d, y -- date ('D, M j',
break;
case 4:
// Last week
return mysql_format_date(monday() - 1);
// m, d, y -- last monday
break;
case 7:
// Last month
return mysql_format_date(mktime(0, 0, 0, month(), 1, year()));
// m, d, y -- date ('D, M j',
break;
case 9:
// Last year
return mysql_format_date(mktime(23, 59, 59, 12, 31, year() - 1));
// m, d, y -- date ('D, M j',
break;
default:
echo __LINE__ . " error error error error error \n";
}
}