This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db_time = '2017-09-21 12:00:00 PM'; | |
$db_timezone = 'Asia/Kolkata'; | |
$user_timezone = 'America/New_York'; | |
date_default_timezone_set($db_timezone); //Change default timezone to old timezone within this function only. | |
$originalTime = new DateTime($db_time); | |
$originalTime->setTimeZone(new DateTimeZone($user_timezone)); //Convert to desired TimeZone. | |
date_default_timezone_set($user_timezone) ; //Reset default TimeZone according to your global settings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Current date | |
echo date('Y-m-d'); | |
// Current time | |
echo date('H:i a'); | |
// Date replated questions refer following link | |
?>http://php.net/manual/en/function.date.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* PHP */ | |
//Get latitude and longitude from geo data | |
$latitudeFrom = '11.016844'; | |
$longitudeFrom = '76.955832'; | |
$latitudeTo = '11.232103'; | |
$longitudeTo = '77.106716'; | |
$unit = 'z'; | |
$theta = $longitudeFrom - $longitudeTo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use below link with custome latitude and longitude for Static map | |
https://maps.googleapis.com/maps/api/staticmap?center=" + latitude + "," + longitude + "&zoom=13&size=300x300&sensor=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db_username = ''; //username | |
$db_password = ''; //password | |
//path to database file | |
$database_path = $_SERVER["DOCUMENT_ROOT"] . "\access\accessdatabase.accdb"; | |
//check file exist before we proceed | |
if (!file_exists($database_path)) { | |
die("Access database file not found !"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Video Details | |
https://www.googleapis.com/youtube/v3/videos?part=snippet&id={video_ID}&key={Google_APIKEY} | |
Video view,like and dislike count details | |
https://www.googleapis.com/youtube/v3/videos?part=statistics&id={video_ID}&key={Google_APIKEY} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE shop_menu | |
ADD CONSTRAINT shop_id | |
FOREIGN KEY (shop_id) REFERENCES shop_details(id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$utc = '2018-04-10 12:51:59 UTC'; | |
$dt = new DateTime($utc); | |
$tz = new DateTimeZone('Asia/Kolkata'); // or whatever zone you're after | |
$dt->setTimezone($tz); | |
echo $dt->format('Y-m-d H:i:s'); | |
exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$array = Array | |
( | |
[0] => Array | |
( | |
[plan] => basic | |
) | |
[1] => Array | |
( | |
[plan] => small |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(jQuery.inArray("test", myarray) !== -1) |
OlderNewer