How can the var_dump() function be used for debugging in PHP?

When debugging in PHP, the var_dump() function can be used to display the type and value of a variable, which can help identify issues in the code such as unexpected data types or values. By using var_dump(), developers can quickly inspect the contents of variables and arrays during the debugging process.

// Example usage of var_dump() for debugging in PHP
$variable = "Hello, World!";
var_dump($variable);