PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Functions will help you execute repetitive tasks while keeping your code somewhat tidy.
Once you've created a function to return a picture, simply call it 5 times.
@ patrikG:
I wouldn´t have only 1 row with 5 pictures, i would have more rows...
And my question is: What must i do, when i would have a break after 5 images, so the script exports numberofimages/5 rows???
marce23[/quote]
Break you code into smaller units, i.e. functions.
One which reads the contents of the directory and returns them.
One which reads the files - one at a time and returns them.
One which generates some HTML and returns it.
And eventually:
one ring to find them and in the webpage, bind them.
Your code becomes clearer, easier to maintain and functions much more smoothly.