How can var_dump be used for debugging purposes in PHP?

When debugging PHP code, var_dump can be used to display the type and value of a variable or expression. This can help identify issues with variable values, data types, or logic errors in the code. By using var_dump, developers can quickly inspect the contents of variables at different points in the code execution to understand what is happening and troubleshoot any problems.

// Example of using var_dump for debugging purposes
$variable = "Hello, World!";
var_dump($variable);