How do i insert an alt tag into an variable <src ="myimage.jpg">

$my_image that has a value of <src =“myimage.jpg”>

How can I modify $my_image to make it <src =“myimage.jpg” alt=“my description”>

Thanks

Hi,

Unless I’m missing something you can simply do:

$my_image = '<src ="myimage.jpg" alt="my description">';