Page 1 of 1

New to PHP, Dynamic array + file counter

Posted: Sat Jan 22, 2005 11:10 am
by kkwong00
hi, I am new to php.
Is there any one can answer me a few questions??

how can I declare dynamic array or something like link list in C??

Is there a "bulit-in" function to count the number of files in certain directory?

Posted: Sat Jan 22, 2005 11:21 am
by feyd
  1. all arrays in php are dynamic, in that you can pop, push, and poke them natively.

    Code: Select all

    $foo = array();
  2. no, there isn't a core function to count files in a directory.. however, there are core functions that can return an array of files based on a pattern like *.txt: glob(). There are functions to open and read directories manually as well, aptly named: opendir() and readdir() respectively.