I want to display files in my directory in browser. I know that this is possible using @opendir and readdir .. But what I want is to limit the numb
Depends on how you want to go about it. There are a ton of javascript/jquery pagination libraries out there .. just google "Javascript pagination."
If javascript is not an option or if you would prefer to just use php, then it should be relatively simple.
Use opendir/readdir to get a list of all the files. Set up however many you want for display. Divide the remainder by this number to get the number of pages. Then take a slice from the array of the (page - 1) * (number to list) up to (number to list). These are the files you will show. Pass the page number through get/post. If it's too high, then use the last page, too low or non-numeric, use the first page.