Guest User

Untitled

a guest
Jun 25th, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.66 KB | None | 0 0
  1. <?
  2.  
  3. $tümKategoriler = "select * from kategoriler"; #Array olarak döndüğünü düşünelim.
  4.  
  5. $tümGaleriler = "select * from galeriler"; #Array olarak döndüğünü düşünelim.
  6.  
  7. $tümGalerilerSon = array();
  8.  
  9. $indis = 0;
  10.  
  11. foreach ($tümGaleriler as $herBirGaleri) {
  12.    
  13.     $tümGalerilerSon[$indis] = $herBirGaleri;
  14.     $tümGalerilerSon[$indis]['id'] = explode("," , $herBirGaleri['id']);
  15.  
  16.     $indis++;
  17.  
  18. }
  19.  
  20. foreach($tümKategoriler as $herBirKategori){
  21.  
  22.     echo $herBirKategori['isim']."<br />";
  23.  
  24.     foreach ($tümGalerilerSon as $herBirGaleri) {
  25.        
  26.         if(in_array($herBirKategori['id'], $herBirGaleri['id']))
  27.             echo $herBirGaleri."<br />";
  28.  
  29.     }
  30.  
  31. }
  32.  
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment