This file contains hidden or 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 | |
/* | |
* find the n closest locations | |
* @param Model $query eloquent model | |
* @param float $lat latitude of the point of interest | |
* @param float $lng longitude of the point of interest | |
* @param float $max_distance distance in miles or km | |
* @param string $units miles or kilometers | |
* @param Array $fiels to return | |
* @return array |
This file contains hidden or 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 | |
function my_is_valid_domain( $url ) { | |
$whitelisted_domains = array( 'mydomain.com', 'mydomain.net' ); | |
$domain = parse_url( $url, PHP_URL_HOST ); | |
// Check if we match the domain exactly | |
if ( in_array( $domain, $whitelisted_domains ) ) | |
return true; | |
$valid = false; |