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
/** | |
* Time Travel returns dates in the past or the future, to a specific format, based on a seed date. | |
* | |
* @param $date_format the format of dates (seed and returned) | |
* @param $date the seed date | |
* @param $where_to time travel "step" in days (e.g. for yesterday "-1", tomorrow "+1" and so forth) | |
*/ | |
function time_travel( $date_format, $date, $where_to ) { | |
return date( $date_format, strtotime( $date . ' ' . $where_to . ' day' ) ); | |
} |
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
/** | |
* Point-in-polygon based on Jordan Curve Theorem | |
* | |
* Checks whether a point with a specific lat, long coordinates is inside | |
* a polygon defined by a given set of points. You can find more information | |
* about the Jordan Curve Theorem to: | |
* http://en.wikipedia.org/wiki/Jordan_curve_theorem | |
* | |
* The algorithm, originally implemented in c/c++ and can be found to | |
* http://sidvind.com/wiki/Point-in-polygon:_Jordan_Curve_Theorem. |