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
Kỹ thuật lập trình
The php anthology 2nd edition 2007 - phần 4
Đang chuẩn bị liên kết để tải về tài liệu:
The php anthology 2nd edition 2007 - phần 4
Bảo Toàn
59
55
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
PHP làm cho thông tin đường dẫn có sẵn trong $ _SERVER ['PATH_INFO'] cho AcceptPathInfo hoặc MultiViews giải pháp, và ['REQUEST_URI'] khi sử dụng mod_rewrite trong $ _SERVER. | 142 The PHP Anthology Simpo PDF Merge and Split Unregistered Version - http www.simpopdf.com Handling Pretty URLs PHP makes the path information available in the _SERVER PATH_INFO for the AcceptPathInfo or MultiViews solutions and in _SERVER REQUEST_URI when using mod_rewrite. We can handle those paths using a simple PHP class that will extract the path information from the incoming request. We ll call the class RequestPath and give it a single private property parts to hold all the parts of our request URLs RequestPath.class.php excerpt class RequestPath private parts array The actual path parsing happens in the __construct method which simply explodes the path on the forward slash character and then proceeds to handle the first two path elements as special cases before dealing with the key-value pairs that follow them. The first thing we do is grab the path and trim the trailing character if there is one RequestPath.class.php excerpt public function __construct if isset _SERVER PATH_INFO path substr _SERVER PATH_INFO -1 substr _SERVER PATH_INFO 0 -1 _SERVER PATH_INFO else path substr _SERVER REQUEST_URI -1 substr _SERVER REQUEST_URI 0 -1 _SERVER REQUeSt_URI Next we split the path into an array on the character. The first element we ll consider to be the action the second we ll consider to be the type Forms Tables and Pretty URLs 143 Simpo PDF Merge and Split Unregistered Version - http www.simpopdf.com RequestPath.class.php excerpt bits explode substr path 1 parsed action array_shift bits parsed parsed action parsed type array_shift bits parsed parsed type The remaining elements we group into key-value pairs. If an odd number of elements remains we simply place the last element on the end of our key-value array RequestPath.class.php excerpt parts_size sizeof bits if parts_size 2 0 parts_size - 1 for i 0 i parts_size i 2 parsed bits i bits i 1 parsed bits i 1 if sizeof bits 2 0 parsed array_pop bits Finally as the last step of our constructor method we assign our
TÀI LIỆU LIÊN QUAN
The WordPress Anthology
The php anthology volume 1
The php anthology volume 2
PHP Các Anthology: 101 Essential Tips, Tricks & Hacks
The php anthology 2nd edition 2007 - phần 1
The php anthology 2nd edition 2007 - phần 2
The php anthology 2nd edition 2007 - phần 3
The php anthology 2nd edition 2007 - phần 4
The php anthology 2nd edition 2007 - phần 5
The php anthology 2nd edition 2007 - phần 6
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.