Is there a built-in PHP function similar to VBA's Nz function for handling null values?

When working with PHP, there isn't a built-in function exactly like VBA's Nz function for handling null values. However, you can achieve similar functionality by using the ternary operator to check if a variable is null and provide a default value if it is.

// Example code snippet to handle null values in PHP
$variable = null;

// Using the ternary operator to check for null values
$result = ($variable !== null) ? $variable : "default value";

echo $result; // Output: "default value"