Are there any best practices for organizing and loading scripts/styles in different sections of a PHP page?

When organizing and loading scripts/styles in different sections of a PHP page, it is best practice to separate them into distinct sections for better readability and maintainability. One common approach is to define all script and style loading functions at the top of the page and then call them in the appropriate sections where they are needed.

<?php
// Define script and style loading functions
function load_scripts() {
    // Load scripts here
}

function load_styles() {
    // Load styles here
}

// Top of the page
load_scripts();

// Header section
load_styles();

// Main content section
load_scripts();

// Footer section
load_styles();
?>