-4

I would like to insert PHP variables inside image tag. Can you please help me in writing the code with escape characters

    <img src='"Images/"<?$j_$i?>.jpg'/>
Mr7-itsurdeveloper
  • 1,631
  • 2
  • 17
  • 24

3 Answers3

1

You should only use <?php

<img src='Images/<?php echo $j.'_'.$i; ?>.jpg'/>    

It's not beautiful,but it's always supported by server

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309
Ben
  • 3,989
  • 9
  • 48
  • 84
0

You need to actually output something.

Use <?= instead of <?.

user229044
  • 232,980
  • 40
  • 330
  • 338
0

Change this:

 <img src='"Images/"<?$j_$i?>.jpg'/> 

To:

 <img src='Images/.<?php echo $j .'_'. $i;?>.jpg'/>
Apollo
  • 36
  • 2