What are common mistakes made in PHP code formatting and how can they be avoided?

One common mistake in PHP code formatting is inconsistent indentation. To avoid this, always use the same number of spaces or tabs for each level of indentation. Another mistake is mixing single and double quotes for string literals, which can lead to confusion. It's best to choose one style and stick with it throughout your code. Example:

// Inconsistent indentation
if ($condition) {
    echo "Hello, world!";
        echo "Another line of code";
}

// Mixing single and double quotes
$message = 'This is a message with "quotes" inside';