I'm currently working on a PHP project and I'm having a bit of difficulty with using a PHP variable inside the `src` attribute of an `img` tag.
I have a variable called `$imageName` which holds the name of an image file. In my HTML file, I want to dynamically display this image by using the value stored in the `$imageName` variable. Here's an example of what I'm trying to achieve:
$imageName = "example.jpg";
<img src="<?php echo $imageName; ?>" alt="Example Image">
However, when I inspect the rendered HTML in the browser, the `src` attribute is not being set to the value of the `$imageName` variable. Instead, it's just displaying the string `$imageName` itself.
I've tried a few different approaches, including using concatenation (`<img src="' . $imageName . '" alt="Example Image">`) and double quotes (`<img src="$imageName" alt="Example Image">`), but nothing seems to be working.
Am I missing something here? How can I properly use my PHP variable inside the `src` attribute of the `img` tag?
Any help or guidance would be greatly appreciated! Thanks in advance.