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 | |
/* | |
Copyright 2011-2013 Chris Jean & iThemes | |
Licensed under GPLv2 or above | |
Version 1.0.2 | |
*/ | |
class PHP_ICO { | |
/** | |
* Images in the BMP format. | |
* |
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 | |
define('MAILGUN_URL', 'https://api.mailgun.net/v3/DOMAIN_NAME'); | |
define('MAILGUN_KEY', 'KEY'); | |
function sendmailbymailgun($to,$toname,$mailfromnane,$mailfrom,$subject,$html,$text,$tag,$replyto){ | |
$array_data = array( | |
'from'=> $mailfromname .'<'.$mailfrom.'>', | |
'to'=>$toname.'<'.$to.'>', | |
'subject'=>$subject, | |
'html'=>$html, |
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 human readable time difference between 2 dates | |
* | |
* Return difference between 2 dates in year, month, hour, minute or second | |
* The $precision caps the number of time units used: for instance if | |
* $time1 - $time2 = 3 days, 4 hours, 12 minutes, 5 seconds | |
* - with precision = 1 : 3 days | |
* - with precision = 2 : 3 days, 4 hours | |
* - with precision = 3 : 3 days, 4 hours, 12 minutes |
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 | |
/** | |
* PHP GeoJSON Constructor, adpated from https://github.com/bmcbride/PHP-Database-GeoJSON | |
*/ | |
# Connect to MySQL database | |
$conn = new PDO('mysql:host=localhost;dbname=mydatabase','myusername','mypassword'); | |
# However the User's Query will be passed to the DB: | |
$sql = 'SELECT * from GDA_database WHERE user_query = whatever'; |
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
public function Parse ($url) { | |
$fileContents= file_get_contents($url); | |
$fileContents = str_replace(array("\n", "\r", "\t"), '', $fileContents); | |
$fileContents = trim(str_replace('"', "'", $fileContents)); | |
$simpleXml = simplexml_load_string($fileContents); | |
$json = json_encode($simpleXml); | |
return $json; | |
} |