New
Fork
Embed
View raw
Report
Algoritma - php
Close
Embed
You can embed this paste into a blog or website with this code:
<iframe class="codetidy" type="text/html" width="100%" src="http://codetidy.com/paste/embed/3004" frameborder="0"></iframe>
Close
Add comment
Name
Comment
Validation
<?
$tumKategoriler
=
"select * from kategoriler"
;
#Array olarak döndü?ünü dü?ünelim.
$tumGaleriler
=
"select * from galeriler"
;
#Array olarak döndü?ünü dü?ünelim.
$tumGalerilerSon
=
array
(
)
;
$indis
=
0
;
foreach
(
$tumGaleriler
as
$herBirGaleri
)
{
$tumGalerilerSon
[
$indis
]
=
$herBirGaleri
;
$tumGalerilerSon
[
$indis
]
[
'id'
]
=
explode
(
","
,
$herBirGaleri
[
'id'
]
)
;
$indis
++;
}
foreach
(
$tumKategoriler
as
$herBirKategori
)
{
echo
$herBirKategori
[
'isim'
]
.
"<br />"
;
foreach
(
$tumGalerilerSon
as
$herBirGaleri
)
{
if
(
in_array
(
$herBirKategori
[
'id'
]
,
$herBirGaleri
[
'id'
]
)
)
echo
$herBirGaleri
.
"<br />"
;
}
}
?>
© 2011 Code Tidy