Ik heb een vraagje om in een array te zoeken. Ik haal vanuit de database de gegevens en stop ze in een array. Ik wil dus NIET zoeken dmv een mysql commando
<?
function show_old_nieuws() {
$old_nieuws = array();
$iCount=0;
$query = "SELECT * FROM ".$this->tabel." ORDER BY 'id' DESC";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_assoc($result)) {
$old_nieuws[$iCount]['id'] = $row['id'];
$old_nieuws[$iCount]['titel'] = $row['titel'];
$old_nieuws[$iCount]['romp'] = $row['romp'];
$old_nieuws[$iCount]['datum'] = $row['datum'];
$iCount++;
}
return $old_nieuws; }
?> het zoeken gaat via een apparte functie:
<?
function zoek ($trefwoord)
{
$old_nieuws=$this->show_old_nieuws();
//etc hier komt de code die ik zoek. is het iets met search_array.