How can code readability be improved in PHP scripts?

To improve code readability in PHP scripts, you can follow coding standards such as PSR-1 and PSR-2, use meaningful variable and function names, properly indent your code, and add comments to explain complex logic or functionality.

// Example of improved code readability
function calculateTotalPrice($quantity, $price) {
    $total = $quantity * $price;
    
    // Apply discount if quantity is greater than 10
    if ($quantity > 10) {
        $discount = $total * 0.1;
        $total -= $discount;
    }
    
    return $total;
}