T_ENCAPSED_AND_WHITESPACE is whitespace which intersects a group of tokens. For example, an "unexpected T_ENCAPSED_AND_WHITESPACE" error is produced by the following code:
<?php
$main_output_world = 'snakes!';
echo('There are' 10 $main_output_world);
?>
Note the missing concatenation operator between the two strings leads to the whitespace error that is so named above. The concatenation operator instructs PHP to ignore the whitespace between the two code tokens (the so named "encapsed" data"), rather than parse it as a token itself.
The correct code would be:
<?php
$main_output_world = 'snakes!';
echo('There are' . 10 . $main_output_world);
?>
Note the addition of the concatenation operator between each token.