Are these quotes correct?

I am stuck. I don’t know if it’s the way I wrote it or something else in the rest of the code. Do you see anything wrong with this code block? Thanks.

Warning: Invalid argument supplied for foreach() on line 168.

<?php
if (isset($ndfilenm)) {
  foreach ($ndfilenm as $item) {
    echo '<img src= "$item" />';
	}
  }
?>

Thanks for your help.

I fixed the quotes and learned something.

Now I will have to find out where in my code $ndfilenm stops holding an array of (UPLOAD_DIR . image names).

Hi kadin,
The error points to the $ndfilenm not being an array of value rather than the quotes.
foreach runs through an array of values - if it doesnt get an array then it cant run properly and fails.

Also the quotes aren’t quite right. If you want to echo a variable inside quotes then they must be double quote


 echo "<img src= \\"$item\\" />"; 

or


 echo "<img src= '$item' />";