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 ( ! function_exists('basic_info')) | |
{ | |
function basic_info() | |
{ | |
$dir = APPPATH; | |
if (is_dir($dir)) { | |
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)) as $filename) { |
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 5.5+ | |
$items = array( | |
array('cost' => 2), | |
array('cost' => 3), | |
array('cost' => 5) | |
); | |
echo array_sum(array_column($items, 'cost')); // output 10 |
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) |
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
<?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
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
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
<?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
// 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 */ | |
//Get latitude and longitude from geo data | |
$latitudeFrom = '11.016844'; | |
$longitudeFrom = '76.955832'; | |
$latitudeTo = '11.232103'; | |
$longitudeTo = '77.106716'; | |
$unit = 'z'; | |
$theta = $longitudeFrom - $longitudeTo; |
NewerOlder