help with value of variable
Posted: Thu Sep 21, 2006 8:39 pm
I have the following code:
I'm using the variable $currentpic twice in the same line. At the first occurence I want it to have a value of minus one of its current value, without actually changing the value of it.
Let's say $currentpic equals 5. I want it to generate the following html code
Thanks.
Code: Select all
echo "<a href=\"something.php?picture=" . $currentpic . "\"><img border=\"0\" src=\"http://www.something.com/images/" . $result['picture_filename'][$currentpic] . "-thumb.jpg\" width=\"" . $width . "\" height=\"" . $height . "\"></a><br>" . "\n";Let's say $currentpic equals 5. I want it to generate the following html code
Code: Select all
<a href="something.php?picture=4"><img border="0" src="http://www.something.com/images/5-thumb.jpg" ........>