What are the potential drawbacks of directly embedding image paths in PHP scripts for avatar display?

Embedding image paths directly in PHP scripts can make the code less maintainable and harder to update in the future. It can also increase the risk of errors if the image paths change or need to be updated. A better approach would be to store the image paths in a separate configuration file or database table, allowing for easier management and updates.

// Config file example
$config = [
    'avatar_path' => '/path/to/avatars/'
];

// Usage in PHP script
$avatarPath = $config['avatar_path'];
echo "<img src='{$avatarPath}user123.jpg' alt='User Avatar'>";