-2

I want to put this line into echo :

<a title=\"Details\" href=\"produit.php?Id_Produit=".$row["id_produit"]."\"><img src=\"photos_produits/".$row["image_url"]."\" /></a>

How can I do this please, I have problem with quotes !

Thanks in advance.

SoufCoder
  • 13
  • 2
  • 1
    you missed several. note I find it a lot easier to parse single quotes for php, and use the double quotes for the html, and there's no need to escape them – nomistic Jul 21 '15 at 15:30

2 Answers2

0

Try this, it might work

echo "<a title='Details' href='produit.php?Id_Produit=" .$row["id_produit"]. "'"><img src='photos_produits".$row["image_url"]. "'/></a>"
SHiv
  • 264
  • 4
  • 10
  • 22
0

Use the easiest, heredoc

$str = <<<ANCHOR
<a title="Details" href="produit.php?Id_Produit={$row["id_produit"]}"><img src="photos_produits/{$row["image_url"]}"></a>
ANCHOR; // make sure there is no extra spaces at the start of this line

echo $str;
viral
  • 3,724
  • 1
  • 18
  • 32