What are the drawbacks of quick and dirty programming practices in PHP?

Quick and dirty programming practices in PHP can lead to code that is difficult to maintain, debug, and scale. It can result in spaghetti code that is hard to understand and prone to errors. To address this issue, it is important to follow best practices such as writing clean, well-documented code, using proper coding standards, and refactoring code regularly to improve its quality.

// Example of refactoring quick and dirty code to improve readability and maintainability
function calculateTotal($items) {
    $total = 0;
    
    foreach($items as $item) {
        $total += $item['price'] * $item['quantity'];
    }
    
    return $total;
}