private function checkPartMatchingType($value, $type)
    {
        switch ($type) {
            case "digit":
                return ctype_digit($value);
                break;

            case "hex":
                return ctype_xdigit($value);
                break;

            case "alpha":
                return ctype_alpha($value);
                break;

            case "alphanum":
                return ctype_alnum($value);
                break;

            default:
                return false;
        }
    }
private function checkPartMatchingType($value, $type)
    {
        switch ($type) {
            case "digit":
                return ctype_digit($value);
                break;

            case "hex":
                return ctype_xdigit($value);
                break;

            case "alpha":
                return ctype_alpha($value);
                break;

            case "alphanum":
                return ctype_alnum($value);
                break;

            default:
                return false;
        }
    }
private function checkPartMatchingType ( $ value , $ type ) { switch ( $ type ) { case "digit" : return ctype_digit ( $ value ) ; break ; case "hex" : return ctype_xdigit ( $ value ) ; break ; case "alpha" : return ctype_alpha ( $ value ) ; break ; case "alphanum" : return ctype_alnum ( $ value ) ; break ; default : return false ; } }
Check if value is matching a certain type of values.

@param string $value   the value to check.
@param array  $type    the expected type to check against.

@return boolean
Check if value is matching a certain type of values .