How can the use of relative paths in PHP scripts improve code flexibility and portability?
Using relative paths in PHP scripts allows for greater code flexibility and portability by making it easier to move the script to different directories or servers without needing to update hardcoded file paths. This can help streamline development and deployment processes, as well as make the code more maintainable in the long run.
// Example of using relative paths in PHP script
require_once(__DIR__ . '/includes/config.php');
include('../utils/functions.php');