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
$list_of_ids = '1,2,3,4,5,6'; | |
if ( cg_validate_int( $list_of_ids ) ) { | |
echo 'Huzzah! We have valide integers!'; | |
} | |
/** | |
* Allows us to pass either an array of or a single intger and validate that they are integers | |
* | |
* @param int|string $list_of_ids Pass either a single integer or a comma separated list | |
* |