Checking Variable Types in PHP


Use gettype() to check a variable’s type, which can be useful for debugging.

Source Code

$var = true;
echo gettype($var); // Outputs: boolean
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments