New to PHP, Dynamic array + file counter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kkwong00
Forum Newbie
Posts: 1
Joined: Sat Jan 22, 2005 11:00 am

New to PHP, Dynamic array + file counter

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply