How can the gettype function be used to determine the type of a variable in PHP?

To determine the type of a variable in PHP, you can use the `gettype` function. This function takes a variable as an argument and returns the data type of that variable as a string. This can be useful when you need to check the type of a variable before performing certain operations on it.

$var = 10;
$type = gettype($var);
echo "The type of the variable is: " . $type;