Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 25th, 2012  |  syntax: PHP  |  size: 0.66 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. ?>