I want to echo the image such that the variables $CatSelected will be the folder of the images and $char and $i are part of the img names : e.g
echo "<img src =\"Images/product/".$CatSelected."/".$char$i."s0.jpg"\>";
I want to echo the image such that the variables $CatSelected will be the folder of the images and $char and $i are part of the img names : e.g
echo "<img src =\"Images/product/".$CatSelected."/".$char$i."s0.jpg"\>";
echo "<img src =\"Images/product/".$CatSelected."/".$char.$i."s0.jpg\"\>";
^ ^
1) You forgot to concatenate $char
and $i
.
2) You forgot to escape the double quotes.
try this
echo "<img src ='Images/product/'".$CatSelected."/".$char$i."'s0.jpg'\>";