A H A H - 1 year ago 66
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?

Answer Source
<img src="<?php echo $str;?>" height="50px" width="50px">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download