I'm trying to figure out why
Assuming the directory
players is located in the same directory where the PHP file is located, you can simply pass
scandir() or other function that works with directories. It is a relative path and most of the times it works.
But, in order to make sure your code always works, you better use the PHP magic constant
__DIR__ to generated the full path of the
should return an array that contains the names of the files stored in the
players directory and passing this array to
count() will correctly return the number of values it contains (as it also does now).