+ 2
What's the statement or function to take input from user in php in any specific data type
console input
3 Answers
+ 2
There are type hints in php5+ where we can define a data type for function parameters.
Or you can use instaceof, is_numeric, is_array, etc
+ 1
Taste can u please give a code to show it
+ 1
Simply
function(boolean $b){
//error if the passed parameter is not boolean
}
And here, where you can see all the available type and how to use them
http://php.net/manual/en/functions.arguments.php#functions.arguments.type-declaration