What are the potential pitfalls of displaying image names in a quiz for users to see and potentially cheat?

Displaying image names in a quiz can potentially allow users to cheat by searching for the images online. To prevent this, you can store the image names in a separate file or database table that is not directly accessible to users. Then, retrieve the image names in the backend and display the images without revealing their names to the users.

// Store image names in a separate file or database table
$imageNames = ['image1.jpg', 'image2.jpg', 'image3.jpg'];

// Retrieve image names from the backend
foreach ($imageNames as $imageName) {
    // Display images without revealing their names
    echo '<img src="images/' . $imageName . '" alt="Image">';
}