How do i assign a unique static string for each item generated in a for loop?

tr1

New Member
How do i assign unique static strings to a variable in a for loop? i'm trying assign a unique decription and alt tag to a list of thumnails. i have managed to get the loop to produce the thumbnails but i cannot work ou tho wot assign unique values to each one based on the condition of the value. this is the for loop:\[code\] <?php for ( $project=1; $project<=40; $project++ ) { echo " <a href=http://stackoverflow.com/"#\" class=\"thumb\"> <img src=http://stackoverflow.com/"images/thumbs/$project.jpg\" width=\"300\" height=\"140\" alt=\"$projectname\" title=\"$projectname\" /> <span class=\"client\">$projectname</span><span class=\"description\">$type</span> </a> "; }?>\[/code\]i tried this before the for loop but didn't work...\[code\] if ( $project = 1 ) { $projectname = "client1"; $type = "Interactive Brochure Design"; } else if ( $project = 2 ) { $projectname = "client2"; $type = "Site Design"; }\[/code\]any help would be great, thanks :)
 
Back
Top