What are some best practices for debugging PHP code before posting it on a forum for help?

Issue: I am getting a syntax error in my PHP code due to missing semicolons. Code snippet:

<?php
$variable1 = "Hello";
$variable2 = "World"

echo $variable1 . " " . $variable2;
?>
```

Fix:
```php
<?php
$variable1 = "Hello";
$variable2 = "World";

echo $variable1 . " " . $variable2;
?>