Jump to content

[SOLVED] Easy Stuff but HELP!


TheFilmGod

Recommended Posts

I'm using html to load a pic. <img src="image/1.jpg">

 

but to make it easy I want to make the "1" in the above to be a php variable so that I can edit it easy.

 

Here is my code:

 

<html>

...

<?php

$num="1";

?>

......

<img src="image/<?php $num; ?>.jpg">

 

why doesn't it work?

Link to comment
https://forums.phpfreaks.com/topic/39259-solved-easy-stuff-but-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.