How can PHP be used to prevent the saving of text or images from a webpage?

To prevent the saving of text or images from a webpage, you can use PHP to disable right-click functionality or implement measures to prevent users from easily saving content.

<?php
// Disable right-click functionality
echo '<script>
document.addEventListener("contextmenu", function(e){
    e.preventDefault();
});
</script>';
?>