It sounds like you plan to have each joke be it's own PHP page?
Joke #1: 0001.php
Joke #2: 0002.php
Joke #3: 0003.php
...
That will work, but considering that each joke is only a small bit of text, and that you probably have a lot of other common stuff on each page, you probably should consider storing the jokes in a database. If you don't want to deal with a database yet, you could store the jokes in simple text files that you then include within the "joke" page.
To address your question of how to build the numerically ascending filenames, first realize that you will need some mechanism to "remember" the last number in the sequence. This could be done a number of ways (no pun intended). If you store each joke in a text file named like 0001.txt, 0002.txt, 0003.txt, there are ways to retrieve the "highest" filename from the directory, break the filename apart (check out basename() or pathinfo() functions), then increase it by one and pad with zeros (check out str_pad() ) to build your new filename. Probably a better method is to store your jokes in a database and simply use an autonumber id to maintain a unique index.
With either of these techniques, you would use a single page (perhaps joke.php). You'd pass a joke ID to the script, and it would return the joke. e.g. joke.php?id=145. joke.php would have code to either include the joke text file or retrieve the joke text from the database.