nhóm và tổng kết, biểu đồ, và công thức chẳng hạn như tính toán cơ bản và tổng số chạy. Phần lớn vật liệu này cũng Chúng tôi đã kết thúc với Violet Elizabeth Bott, không có nhiều cải thiện. Chúng ta có thể đối phó với vấn đề này bằng cách làm cho các chuỗi chữ thường trình với strtolower () trước khi gọi ucwords () | When the loop reaches the file named 0 the string returned by readdir resolves to false which causes the loop to end. The approach in Listing uses to check that the return value returned by readdir is not exactly equivalent to false. 0 only resolves to false in the test so we circumvent the problem. If you find the ordering of items in a directory listing to be arbitrary it s because the order is determined by the file system. If you want the items ordered in a specific fashion you must read the contents into an array which can then be sorted to your liking and subsequently displayed. Team LiB 1 PREVIOUS NEXT Team LiB 1 PREVIOUS NEXT Summary In this hour you learned how to use include to incorporate files into your documents and to execute any PHP code contained in include files. You learned how to use some of PHP s file test functions. You explored functions for reading files by the line by the character and in arbitrary chunks. You learned how to write to files either replacing or appending to existing content. Finally you learned how to create remove and read directories. Now that we can work with files we can save and access substantial amounts of data. If we need to look up data from large files however our scripts begin to slow down quite considerably. What we need is some kind of database. Team LiB 1 PREVIOUS NEXT Team LiB 1 PREVIOUS NEXT Q A Q1 Does the include statement slow down my scripts A1 Because an included file must be opened and parsed by the engine it adds some overhead. However the benefits of reusable code libraries often outweigh the relatively low performance overhead. Q2 Should I always end script execution if a file cannot be opened for writing or reading A2 You should always allow for this possibility. If your script absolutely depends on the file you want to work with you might want to use the die function writing an informative error message to the browser. In less critical situations you still need to allow for the failure perhaps