Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
<?php
2
 
3
/***************************************************************************
4
 *   Copyright (C) 2009-2011 by Geo Varghese(www.seopanel.in)  	   		   *
5
 *   sendtogeo@gmail.com   												   *
6
 *                                                                         *
7
 *   This program is free software; you can redistribute it and/or modify  *
8
 *   it under the terms of the GNU General Public License as published by  *
9
 *   the Free Software Foundation; either version 2 of the License, or     *
10
 *   (at your option) any later version.                                   *
11
 *                                                                         *
12
 *   This program is distributed in the hope that it will be useful,       *
13
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
14
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
15
 *   GNU General Public License for more details.                          *
16
 *                                                                         *
17
 *   You should have received a copy of the GNU General Public License     *
18
 *   along with this program; if not, write to the                         *
19
 *   Free Software Foundation, Inc.,                                       *
20
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
21
 ***************************************************************************/
22
 
23
/**
24
 * function to get from time
25
 * @param Array $info API input details
26
 * @return $fromTime	The timestamp of from time
27
 */
28
function getFromTime($info) {
29
 
30
	// if from time is not empty
31
	if (!empty($info['from_time'])) {
32
		$fromTime = strtotime($info['from_time'] . ' 00:00:00');
33
	} else {
34
		$fromTime = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
35
	}
36
 
37
	return $fromTime;;
38
}
39
 
40
/**
41
 * function to get to time
42
 * @param Array $info API input details
43
 * @return $fromTime	The timestamp of to time
44
 */
45
function getToTime($info) {
46
 
47
	// if from time is not empty
48
	if (!empty($info['to_time'])) {
49
		$toTime = strtotime($info['to_time'] . ' 00:00:00');
50
	} else {
51
		$toTime = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
52
	}
53
 
54
	return $toTime;;
55
}
56
 
57
/**
58
 * function to remove braces from string
59
 * @param String $str		The string to be replaced
60
 * @return mixed $str		The converted string
61
 */
62
function removeBraces($str) {
63
	$str = str_replace(array('(', ')'), '', $str);
64
	return $str;
65
}
66
?>