Is it considered best practice to use meta refresh for updating specific sections of a webpage in PHP?

Using meta refresh for updating specific sections of a webpage in PHP is not considered best practice as it can lead to accessibility and usability issues. Instead, it is recommended to use AJAX (Asynchronous JavaScript and XML) to dynamically update content on a webpage without having to refresh the entire page.

<?php
// Example of using AJAX to update specific section of a webpage
?>
<html>
<head>
    <script>
        function updateSection() {
            var xhttp = new XMLHttpRequest();
            xhttp.onreadystatechange = function() {
                if (this.readyState == 4 && this.status == 200) {
                    document.getElementById("sectionToUpdate").innerHTML = this.responseText;
                }
            };
            xhttp.open("GET", "update_section.php", true);
            xhttp.send();
        }
    </script>
</head>
<body>
    <div id="sectionToUpdate">
        <!-- Content to be updated dynamically -->
    </div>
    <button onclick="updateSection()">Update Section</button>
</body>
</html>