How to solve 'unexpected t_constant_encapsed_string' in php?

Example:

echo "Hello "World";

This error occurs when there's a syntax error in your string. The quotes inside the string terminate it prematurely.

Solution:

Escape the internal quotes or use different types of quotes.


echo "Hello 'World'";
// or
echo 'Hello "World"';

Beginner's Guide to PHP