Okay, so I have this confusing problem with a string. I'm using a loop to construct the string, and I use
'terms' => array($exclude),
'terms' => array(101,102,135),
When you do this
'terms' => array($exclude)
terms array looks like this:
Array (  => 101,102,135 )
'terms' => explode(',', $exclude)
Array (  => 101  => 102  => 135 )
You are assigning a string to the 0-th key in array, whereas you should be passing array elements.
explode will split up your string into an array based on a passed
delimiter (in your case a comma).