Click here to Skip to main content
15,885,032 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
i want to get set first 12 images in <li> tag and set rest of the images in saparate <li> tag this is my code but i can't find how can i do that

where i place second <li> tag?
any ideas thanx in advance!

PHP
<?php
				$ImageDisplay = "";
				$Images = scandir("images");
				$ignore = array(".","..");
				$i=1;
				$time=0;
				
				echo('<li>');
				
				foreach ($Images as $file) {			
						if($time<12){	
							if(!in_array($file, $ignore)) 
							{						
								echo('<img id="'.$i.'" src="images/'.$file.'">');	
								$i++;
								$time++;
							}
						}
						
						else {																
							echo('<img id="'.$i.'" src="images/'.$file.'">');	
							$i++;						
					}	
					}
									
						
				echo('</li>');
							
			?>
Posted
Comments
Sergey Alexandrovich Kryukov 4-Oct-14 16:00pm    
What you are trying to achieve is not clear. An example of input data and HTML output could help.
Changes are, it will help to your write correct code by yourself.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900