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?
New to PHP, Dynamic array + file counter
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
- all arrays in php are dynamic, in that you can pop, push, and poke them natively.
Code: Select all
$foo = array(); - 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.