Parse error, unexpected T_STRING, expecting ',' or ';'
In PHP, a common problem that may arise while creating a PHP file is the parse error T_String. This happens when a programmer (or a code literate person) inserts an apostrophe in a series of codes already being limited by apostrophes. Having several apostrophes in a same command creates a huge conflict within the PHP document and the program will have huge problems in reading the codes that have been written.
Example 1
<?
echo 'we don't know';
?>
How to solve the problem
The above example can be solved simply by telling the program where to ignore the apostrophe, by inserting a slash before the apostrophe that is not being used as a command. Hence, the code above will be written as:
<?
echo 'we don\t know';
?>
Example 2
The Parse Error can also arise if the programmer has forgotten to insert the ; symbol at the end of the command.
<?
echo 'we \"don't\" know'
?>
Note: PHP is a simple program that asks for much attention. You should not have any problem with it if you pay enough attention to the logical flow of the program.