Which PHP function is used to check if a variable is of a specified type?
- gettype()
- is_type()
- checktype()
- is_a()
The PHP function used to check if a variable is of a specified type is is_type(). This function allows you to verify whether a variable belongs to a specific data type, such as string, integer, float, boolean, or array. It returns a boolean value indicating whether the variable matches the specified type. For further information, see: http://php.net/manual/en/function.is-string.php, http://php.net/manual/en/function.is-int.php, http://php.net/manual/en/function.is-float.php, http://php.net/manual/en/function.is-bool.php, http://php.net/manual/en/function.is-array.php
Loading...
Related Quiz
- Which of the following are true about the for loop in PHP?
- PHP requires a web server to run PHP scripts.
- Which of the following are ways to include a file in PHP?
- On which of the following operating systems can PHP be installed?
- Which of the following are true about the default keyword in a PHP switch statement?