user2805663
user2805663

Reputation:

echo img with other folder

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

Answers (4)

Akshaya Moorthy
Akshaya Moorthy

Reputation: 307

echo '< img src="upload/'.$value['searchresultimg'].'">';

This will work.

Upvotes: 0

Spider
Spider

Reputation: 524

echo "<img src=".'upload/'.$value['searchresultimg'].">";

I think You missed a dot (.)

Upvotes: 0

John Robertson Nocos
John Robertson Nocos

Reputation: 1485

Escape double quotes using backslashes \ \.

echo "<img src=\"admin/" . $value['searchresultimg'] . "\">";

Upvotes: 0

kefy
kefy

Reputation: 535

echo "<img src=\"admin/".$value['searchresultimg']."\">";

Upvotes: 1

Related Questions