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 | |
$vars = get_defined_vars(); | |
echo '<pre>' . print_r($vars, 1) . '</pre>'; | |
?> |
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
/** | |
* Validate a phone number. | |
* | |
* @param $value | |
* A phone number as string. | |
* @param $formats | |
* The formats to validate for. | |
* @return | |
* TRUE or FALSE if it validates. | |
*/ |
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
/** | |
* Validate a postal code. | |
* | |
* @param $value | |
* A postal code as string. | |
* @param $country | |
* The country postal code format. | |
* @return | |
* TRUE or FALSE if it validates. | |
*/ |
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
/** | |
* Validate a Human Name | |
* | |
* @param $name | |
* A name as a string. | |
* @return | |
* TRUE or FALSE if name is a valid human name. | |
*/ | |
function valid_human_name($name) { | |
return preg_match("/^[A-Z][a-zA-Z '&-]*[A-Za-z]$/", $name); |