Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 19:23

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



glob() und in_array()

Discussion on glob() und in_array() within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1

 
iKyroja :>'s Avatar
 
elite*gold: 20
Join Date: May 2010
Posts: 2,792
Received Thanks: 1,988
glob() und in_array()

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');
            
        } 
iKyroja :> is offline  
Old 12/18/2012, 21:27   #2
 
NotEnoughForYou's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 3,406
Received Thanks: 2,024
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');
}    
?>
NotEnoughForYou is offline  
Thanks
1 User
Old 12/18/2012, 21:30   #3

 
iKyroja :>'s Avatar
 
elite*gold: 20
Join Date: May 2010
Posts: 2,792
Received Thanks: 1,988
Danke :O, dickes THX
iKyroja :> is offline  
Reply


Similar Threads Similar Threads
Darkorbit [GLOB 6 + SPAIN 4]
12/15/2012 - DarkOrbit Trading - 17 Replies
Hi, I have two accounts for sale on darkorbit: 1. Global Europe 6 5 Hangars (goli + veng + leonov) Much b02+lf3 1 LF-4 8 Drones + Apis PET Lvl 15! --> 40PP!! <--
[DO] ######### S/V-> Glob 4 LvL 18 , 47 x LF4 + Apis & Zeus <-S/V #########
12/27/2011 - Browsergames Trading - 16 Replies
Hallo o0Beny0o, Deine aktuelle Position im Ranking ist 240 Du hast 1.000.000.000+ Erfahrungspunkte und 300.000 Ehre erspielt. Dein aktueller Level ist 18. Du hast 1000 Raumschiffe und 250.000 Aliens vernichtet. = 210.000 Rangpunkte
[DO] ######### S/V-> Glob 4 LvL 19 , 47 x LF4 + Apis & Zeus <-S/V #########
11/25/2011 - Browsergames Trading - 14 Replies
Hallo o0Beny0o, Deine aktuelle Position im Ranking ist 240 Du hast 2.000.000.000+ Erfahrungspunkte und 550.000 Ehre erspielt. Dein aktueller Level ist 19. Du hast 1000 Raumschiffe und 250.000 Aliens vernichtet. = 210.000 Rangpunkte
>>>[B]Do top De6 Acc mit Titel![S]PSC oder Glob EU 1 Acc<<<
10/05/2011 - Browsergames Trading - 2 Replies
Verkauft! Wie der Titel schon sagt möchte ich mein Acc auf De6 gegen ein Acc auf Glob Eu 1 eintauschen. Evtl würde ich bei guten Angeboten auch Geld nehmen. Zu den Daten: Server: De6 Schiff: Goliath Drohnen: 0x Flax;; 8x Iris;; 0x Apis Reparatur-Gutscheine: 234
[B][tausche][/B] DarkOrbit Acc [B]Glob.Europa1 LVL 17[/B]
01/24/2011 - DarkOrbit - 0 Replies
Was hat der Acc zu bieten? Punkte und Daten -494 Mio EP -2,1 Mio Ehre -LVL 17 -5379 Raumschiffe -123.000 Aliens -163.000 Rangpunkte -Rang: Major



All times are GMT +1. The time now is 19:24.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.