TAILIEUCHUNG - PHP: The Good Parts: Delivering the Best of PHP- P8

PHP: The Good Parts: Delivering the Best of PHP- P8: Vượt qua tất cả các hype về PHP và thâm nhập vào sức mạnh thực sự của ngôn ngữ này. Cuốn sách này khám phá những tính năng hữu ích nhất của PHP và làm thế nào họ có thể đẩy nhanh quá trình phát triển web, và giải thích lý do tại sao thường được sử dụng PHP yếu tố thường được sử dụng sai hoặc misapplied. Bạn sẽ tìm hiểu thêm phần nào sức mạnh để lập trình hướng đối tượng, và làm thế nào để sử dụng. | The PHP documentation points out that closures are also great for use in callback functions when you are walking through an array for example and you want to run a function against each element of an array. Here is a very simple example person_info function value key echo key . . value . br person_array array name Dawn age 15 eyecolor green array_walk person_array person_info Here we pass an actual variable to the array_walk function as its second parameter rather than as a true reference to a function. NOWDOC The next enhancement I d like to bring to your attention is called NOWDOC which is merely a variation on the HEREDOC functionality in relation to string management. If you recall HEREDOC text behaves the same as if you were working with a string within double quotes in that it allows for the inclusion of variable content directly within the string such that the content of the variable will be resolved within the string. The NOWDOC construct behaves the same as if you were dealing with strings in single quotes in that there is no resolution of variable content no interpolation as the token is defined with single quotes. Here is an example of HEREDOC and NOWDOC to contrast what each does myname Peter MacIntyre str HEREDOC_Example Lorem ipsum dolor sit amet nibh euismod tincidunt myname . HEREDOC_Example echo str str2 NOWDOC_Example Lorem ipsum dolor sit amet nibh euismod tincidunt myname . NOWDOC_Example echo br . str2 And here is the expected browser output Lorem ipsum dolor sit amet nibh euismod tincidunt Peter MacIntyre. Lorem ipsum dolor sit amet nibh euismod tincidunt myname. NOWDOC 123 I i r i The NOWDOC construct lends itself to longer segments of text that don t require any character or variable escaping like the body of a standard email message or some disclaimer text on a report. goto Operator If you have ever used a language like Basic or Visual Basic you know all about the goto statement in those languages. There was reportedly a great struggle

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.