Click here to Skip to main content
15,441,508 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: Database connection refused. Pin
taiwokaffo6-Dec-16 23:06
Membertaiwokaffo6-Dec-16 23:06 
QuestionPHP topic selection for Final year Project Pin
Member 1278820324-Nov-16 2:51
MemberMember 1278820324-Nov-16 2:51 
GeneralRe: PHP topic selection for Final year Project Pin
Kornfeld Eliyahu Peter24-Nov-16 5:08
professionalKornfeld Eliyahu Peter24-Nov-16 5:08 
AnswerRe: PHP topic selection for Final year Project Pin
Richard MacCutchan24-Nov-16 6:37
mveRichard MacCutchan24-Nov-16 6:37 
GeneralRe: PHP topic selection for Final year Project Pin
Member 127882035-Dec-16 22:17
MemberMember 127882035-Dec-16 22:17 
GeneralRe: PHP topic selection for Final year Project Pin
Member 127882036-Dec-16 22:35
MemberMember 127882036-Dec-16 22:35 
QuestionSeveral arrays to one multidimensional Pin
Member 128309193-Nov-16 5:29
MemberMember 128309193-Nov-16 5:29 
AnswerRe: Several arrays to one multidimensional Pin
WildDonkey11-Feb-17 3:59
MemberWildDonkey11-Feb-17 3:59 
My proposition is to modify the code in the following way:
PHP
<?php
        //FOLDERS
        //create array for each directory
        $pathDIR = "dirname/";
        $DIR = Array(
        );
        //store directory names into an array with foreach
        foreach (glob($pathDIR . '/[0-30]*', GLOB_ONLYDIR) as $dirname) {
            $DIR[] = $dirname;    
        }
        //display path directories
        for($a = 0; $a < count($DIR); $a++) {
            echo $DIR[$a];   
        }
        //FILES
        //create array for each directory
        $pathFILE = Array();
        //create array for files    
        $files = Array();            
        //loop start
        for($b = 1; $b <= count($DIR); $b++) {
            $pathFILE[$b] = "dirname/" . $b . "/"; 
            $files[$b] = Array();
            //store files in array with foreach
            foreach(glob($pathFILE[$b] . '*.jpg') as $filename) {
                $files[$b][] = $filename;
            }
        }
        //display files
        for($d = 1; $d <= count($files); $d++) {
            for($e = 0; $e <= count($files[$d]); $e++) {
                echo $files[$d][$e];
            }
            echo "\r\n\r\n";
        }
        ?>


remember you can display files simlper way:
PHP
var_dump($files);

QuestionOOP in PHP Pin
Member 1278820328-Oct-16 4:22
MemberMember 1278820328-Oct-16 4:22 
AnswerRe: OOP in PHP Pin
Anurag Gandhi13-Nov-16 6:09
professionalAnurag Gandhi13-Nov-16 6:09 
GeneralRe: OOP in PHP Pin
Peter_in_278013-Nov-16 13:38
professionalPeter_in_278013-Nov-16 13:38 
GeneralRe: OOP in PHP Pin
Member 1278820324-Nov-16 2:03
MemberMember 1278820324-Nov-16 2:03 
GeneralRe: OOP in PHP Pin
Afzaal Ahmad Zeeshan24-Nov-16 2:19
mveAfzaal Ahmad Zeeshan24-Nov-16 2:19 
GeneralRe: OOP in PHP Pin
kribo5-Dec-16 3:26
professionalkribo5-Dec-16 3:26 
AnswerRe: OOP in PHP Pin
Anurag Gandhi5-Dec-16 3:48
professionalAnurag Gandhi5-Dec-16 3:48 
AnswerRe: OOP in PHP Pin
Afzaal Ahmad Zeeshan24-Nov-16 2:21
mveAfzaal Ahmad Zeeshan24-Nov-16 2:21 
GeneralRe: OOP in PHP Pin
Member 1278820324-Nov-16 3:21
MemberMember 1278820324-Nov-16 3:21 
AnswerRe: OOP in PHP Pin
kribo5-Dec-16 3:32
professionalkribo5-Dec-16 3:32 
GeneralRe: OOP in PHP Pin
Member 127882035-Dec-16 6:30
MemberMember 127882035-Dec-16 6:30 
QuestionRequest: Php 7 Tutorial/Course Recommendation From You Pin
Member 127834388-Oct-16 16:36
MemberMember 127834388-Oct-16 16:36 
QuestionRun multiple PHP versions on same server Pin
manhfh7-Oct-16 6:14
Membermanhfh7-Oct-16 6:14 
QuestionOnly Home page opening after going live Pin
Member 1275803925-Sep-16 20:28
MemberMember 1275803925-Sep-16 20:28 
SuggestionRe: Only Home page opening after going live Pin
Richard Deeming26-Sep-16 2:07
mveRichard Deeming26-Sep-16 2:07 
AnswerRe: Only Home page opening after going live Pin
Richard MacCutchan26-Sep-16 2:48
mveRichard MacCutchan26-Sep-16 2:48 
AnswerRe: Only Home page opening after going live Pin
ZurdoDev26-Sep-16 3:18
professionalZurdoDev26-Sep-16 3:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.