Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Cơ sở dữ liệu
PHP and MySQL Web Development - P20
Đang chuẩn bị liên kết để tải về tài liệu:
PHP and MySQL Web Development - P20
Việt Phương
109
5
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
PHP and MySQL Web Development - P20: PHP and MySQL Web Development teaches the reader to develop dynamic, secure, commercial Web sites. Using the same accessible, popular teaching style of the first edition, this best-selling book has been updated to reflect the rapidly changing landscape of MySQL and PHP. | 62 Chapter 2 Storing and Retrieving Data Opening a File for Reading fopen Again we open the file using fopen . In this case we are opening the file for reading only so we use the file mode r fp fopen DOCUMENT_ROOT . orders orders.txt r Knowing When to Stop feof In this example we use a while loop to read from the file until the end of the file is reached.The while loop tests for the end of the file using the feof function while feof fp The feof function takes a file pointer as its single parameter. It will return true if the file pointer is at the end of the file. Although the name might seem strange it is easy to remember if you know that feof stands for File End Of File. In this case and generally when reading from a file we read from the file until EOF is reached. Reading a Line at a Time fgets fgetss and fgetcsv In our example we use the fgets function to read from the file order fgets fp 999 This function is used to read one line at a time from a file. In this case it will read until it encounters a newline character n encounters an EOF or has read 998 bytes from the file. The maximum length read is the length specified minus one byte. There are many different functions that can be used to read from files.The fgets function is useful when dealing with files that contain plain text that we want to deal with in chunks. An interesting variation on fgets is fgetss which has the following prototype string fgetss int fp int length string allowable_tags This is very similar to fgets except that it will strip out any PHP and HTML tags found in the string. If you want to leave any particular tags in you can include them in the allowable_tags string.You would use fgetss for safety when reading a file written by somebody else or containing user input. Allowing unrestricted HTML code in the file could mess up your carefully planned formatting. Allowing unrestricted PHP could give a malicious user almost free rein on your server. The function fgetcsv is another variation .
TÀI LIỆU LIÊN QUAN
PHP and MySQL Web Development
Beginning PHP 6, Apache, MySQL 6 Web Development
www.it-ebooks.info .PHP & MySQL FOR ® Web Development ALL-IN-ONE DESK REFERENCE DUMmIES ‰ by Janet Valade with Tricia Ballad and Bill Ballad www.it-ebooks.info .www.it-ebooks.info .PHP & MySQL FOR ® Web Development ALL-IN-ONE DESK REFERENCE DU
ICT 5 Web Development - Chapter 6.1: Using MySQL with PHP
PHP & MySQL Web Development All-in-One Desk Reference For Dummies
Beginning PHP6, Apache, MySQL Web Development
Web Application Development with Yii and PHP
ICT 5 Web Development - Chapter 6.2: MySQL & PHP Advanced
BEGINNING PHP5.APACHE.MYSQL WEB DEVELOPMENT
PHP 5 e-commerce Development- P33PHP 5 e-commerce Development- P33
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.