Breaking News
Home / Web / PHP / PHP FAQ / PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE

PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE

Issue

The PHP script script gives an error the following error

[27-Dec-2011 19:48:20] PHP Parse error:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /Users/jake/Sites/projects/webservices/projects/uploader/index.php on line 227

echo”<option value=”$rows[‘id’]” $selected]]>$rows[‘name’]</option>”;

Solution

Please make sure the double quotes and quotes are matching properly. If there are double quotes in the String they can be escaped using the operator as “

[pb_builder]

Check Also

What is the structure of a PHP Program?

Program Organization is key to readability, ease of debugging, few bugs, simplicity and more. As …

Advertisment ad adsense adlogger