How can var_dump() be used to inspect variable contents in PHP?
When working with PHP variables, it can be helpful to inspect their contents to understand their data type and value. The var_dump() function in PHP allows you to do this by displaying the variable type and value in a structured format. This can be especially useful for debugging code or understanding the structure of complex variables like arrays or objects.
```php
$variable = "Hello, World!";
var_dump($variable);
```
In this code snippet, the var_dump() function is used to inspect the contents of the $variable variable. When this code is executed, it will output information about the variable, including its data type (string) and value ("Hello, World!"). This can be helpful for understanding the contents of variables in your PHP code.