A quick look through the index.php or the include.php files of any module will quickly show many functions that are used over and over in module development.
In PhpStorm you can get the documentation for that function via the docblock reference lookup feature. Ctrl+q while looking at the function.
jrCore_checktype is a function that is used to verify that the contents of the variable are what is expected.
The jrCore_checktype function takes the variable as its first parameter and the checktype as its second.
The types of checktype that are available are:
- Ensures value is a string and is allowed to contain HTML allowed in the profile's quota
- the numbers 0-9, letters a-z and _ (underscore)
- a valid date
- a valid domain name (no www)
- a valid email address
- a floating point number
- a hexadecimal value
- a valid IP Address
- boolean TRUE or int or string "1"
- valid 32 character long MD5 hash
- a string with more than 1 word
- a string of any length
- an integer
- an integer greater than or equal to zero (0)
- an integer greater than or equal to one (1)
- either "on" or "off"
- a price in D.CC format
- UTF-8 characters with HTML stripped
- a 40 character SHA1 hash
- a string that does not contain HTML or hidden characters
- a valid URL
- the numbers 0-9, letters a-z, _ and - (dash)
- the numbers 0-9, letters a-z, _ (underscore), - (dash) and spaces
- string that can contain a . (dot)
- "yes" or "no"
- check if a string is json or not
We can see this too when we use the ctrl+q
option on the function