test_1.php
3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
$currentDate = strtotime("+24 hours", strtotime(date('Y-m-d H:i:s')));
$currentDate = date('Y-m-d H:i:s', $currentDate);
echo $currentDate."<br/>";
$currentDate = strtotime("-24 hours", strtotime(date('Y-m-d H:i:s')));
$currentDate = date('Y-m-d H:i:s', $currentDate);
echo $currentDate;
exit();
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of test
*
* @author Administrator
*/
function renderCouponCode() {
//date('ymdhis');
return date('His') . randDomChar(2) . date('ymd');
}
function randDomChar($length = 10) {
$string = '';
// You can define your own characters here.
$characters = "ABCDEFHJKLMNPRTVWXYZabcdefghijklmnopqrstuvwxyz";
for ($p = 0; $p < $length; $p++) {
$string .= $characters[mt_rand(0, strlen($characters) - 1)];
}
return $string;
}
//echo renderCouponCode()."<br/>";
//$currentDate = strtotime("+3 day", strtotime(date('Y-m-d')));
//$currentDate1 = strtotime(date('Y-m-d'));
echo date('Y-m-d H:i:s') . "<br/>";
$currentDate = strtotime("+6 hours", strtotime(date('Y-m-d H:i:s')));
echo date('Y-m-d H:i:s', $currentDate) . "<br/>";
echo date('Y-m-d', strtotime('2016-05-11 11:18:10')) . "<br/>";
$startDate = '2016-05-11 11:18:10';
$endDate = '2016-05-11 11:20:10';
$startDate = strtotime(date('Y-m-d', strtotime($startDate)));
$endDate = strtotime(date('Y-m-d', strtotime($endDate)));
echo $endDate - $startDate;
/**<span class="tribe-event-date-start">August 3 @ 8:00 am</span>
-
<span class="tribe-event-date-end">August 7 @ 5:00 pm</span>
<div class="recurringinfo"><div class="event-is-recurring"><span class="tribe-events-divider">
/**
* $arrayStringTitle = explode('-', str_replace(array('<span class="tribe-event-date-start">', '<span class="tribe-event-date-end">', '</span>'), array('', '', ''), $title));
$time1 = '';
$time2 = '';
$time3 = '';
$time4 = '';
print_r($arrayStringTitle);
if (count($arrayStringTitle) >= 2) {
$stringTime1 = (isset($arrayStringTitle[0]) && $arrayStringTitle[0]) ? $arrayStringTitle[0] : '';
if ($stringTime1) {
$arrayStringTime1 = explode('@', $stringTime1);
// print_r($arrayStringTime1);
// exit();
if (count($arrayStringTime1) == 2) {
$time1 = isset($arrayStringTime1[0]) ? $arrayStringTime1[0] : '';
$time2 = isset($arrayStringTime1[1]) ? $arrayStringTime1[1] : '';
//echo $time1;
//exit();
}
}
$stringTime2 = (isset($arrayStringTitle[1]) && $arrayStringTitle[1]) ? $arrayStringTitle[1] : '';
if ($stringTime2) {
$arrayStringTime2 = explode('@', $stringTime2);
if (count($arrayStringTime2) == 2) {
$time3 = isset($arrayStringTime2[0]) ? $arrayStringTime2[0] : '';
$time4 = isset($arrayStringTime2[1]) ? $arrayStringTime2[1] : '';
}
}
}
if ($time1 && $time2 && $time3 && $time4) {
$title = '<span class="tribe-event-date-start">' . trim($time1) . " - " . trim($time3) . "</span> @ <span class='tribe-event-date-end'>" . trim($time2) . " - " . trim($time4) . "</span>";
}
*/