A H A H - 2 months ago 14x
PHP Question

How to pass a string from PHP into an html tag?

I have a string, an img url, in a php block called $str. And I want to set that string as the img src in an img src but its not working.

<img src="<?php $str ?>" height="50px" width="50px">

how else can i set the src to the $str string?

<img src="<?php echo $str;?>" height="50px" width="50px">