You are here: happy new year with a simpleton question... « All PHP « IT news, forums, messages
happy new year with a simpleton question...

Posted by windandwaves on 01/01/06 11:51

Hi Folk

Happy New Year!

I am trying to make my page a bit more interesting by adding "random"
pictures (7 in total).

I use the following line:

$v = (str_replace('<h2>', '<div class="imgholder"><img
src="i/t'.floor(rand(1,7)).'.jpg" alt="test" /></div><h2>', $v));

where $v is the content of my page. Before every <h2> it adds a pucture.
However, it is the same picture all the way through the page. How can I get
to a random picture (without replacement if possible)?

Thanks in advance

Nicolaas

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация