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