glob() und in_array()

12/17/2012 15:56 iKyroja :>#1
Ich möchte mit glob() ein array der Dateien ausgeben,
sie dan mit in_array überprüfen ich bekomme das aber nicht so hin.

PHP Code:
glob($filePath."*.php"); 
Ich kann es ja in ner foreach schleife auslesen aber wie soll ich das dan
da einbinden:

PHP Code:
 $filePath ".".DIRECTORY_SEPARATOR."scripts".DIRECTORY_SEPARATOR."pages".DIRECTORY_SEPARATOR;
       
           if(isset(
$_GET['page']) && !empty($_GET['page'])) {
            
            
$getFile str_replace("\0"''$_GET['page']);
            
$includeFile realpath($filePath.$getFile.'.php');
                        
            if(
file_exists($includeFile) && is_readable($includeFile)) {
                
                include_once(
$includeFile);
                
            } else {
                
                include_once(
$filePath.'404.php');
                
            }
            
        } else {
            
            include_once(
$filePath.'home.php');
            
        } 
12/18/2012 21:27 NotEnoughForYou#2
PHP Code:
<?php
$filePath 
".".DIRECTORY_SEPARATOR."scripts".DIRECTORY_SEPARATOR."pages".DIRECTORY_SEPARATOR;
       
if(isset(
$_GET['page']) && !empty($_GET['page'])) {
    
$getFile str_replace("\0"''$_GET['page']);
    
$includeFile realpath($filePath.$getFile.'.php');
    
$files glob($filePath."*.php");
                     
    if(
file_exists($includeFile) && is_readable($includeFile)) {
        if(
in_array($filePath.$_GET['page'].'.php'$files)) {                
            include_once(
$includeFile);                
        } 
        else {                
            include_once(
$filePath.'404.php');                
        }
    }
    else {                
        include_once(
$filePath.'404.php');
    }

else {
    include_once(
$filePath.'home.php');
}    
?>
12/18/2012 21:30 iKyroja :>#3
Danke :O, dickes THX