Reputation:
echo "<img src="'admin/'.$value['searchresultimg'].">";
This is a code for my echo image this is the correct address but why i am getting Parse error: syntax error, unexpected ''admin/'' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in
i think my double quotes are ok here because i have single inside.I have search google for same problem but i didn't find any.i tried putting it in ""
but i didnt work.i have no more idea on this matter. Any suggestion here is appreciated.
update
my double qoutes is not OK
escape double qoutes fixes the problem
Upvotes: 0
Views: 50
Reputation: 307
echo '< img src="upload/'.$value['searchresultimg'].'">';
This will work.
Upvotes: 0
Reputation: 524
echo "<img src=".'upload/'.$value['searchresultimg'].">";
I think You missed a dot (.)
Upvotes: 0
Reputation: 1485
Escape double quotes using backslashes \ \
.
echo "<img src=\"admin/" . $value['searchresultimg'] . "\">";
Upvotes: 0