What are some best practices for code formatting in PHP to improve clarity and readability?

When writing PHP code, it is important to follow best practices for code formatting to improve clarity and readability. One common practice is to use consistent indentation, typically 4 spaces or a tab, to visually separate different code blocks. Additionally, using meaningful variable and function names, as well as commenting your code to explain complex logic or functionality, can greatly enhance understanding for yourself and others who may read your code.

// Example of properly formatted PHP code
function calculateTotal($price, $quantity) {
    $total = $price * $quantity;
    
    return $total;
}