TAILIEUCHUNG - PHP 5/MySQL Programming- P22

PHP 5/MySQL Programming- P22:computer programming has often been seen as a difficult and arcane skill. Programming languages are difficult and complicated, out of the typical person’s reach. However, the advent of the World Wide Web has changed that to some extent. It’s reasonably easy to build and post a Web page for the entire world to see. The language of the Web is reasonably simple, and numerous applications are available to assist in the preparation of static pages | 83 print verse 3 print chorus print verse 4 print chorus The program is to print the first verse then the chorus then the second verse then the chorus and so on. The details of how all these things are to be generated is left to the individual functions. This is an example of encapsulation. Encapsulation is good because it allows you to think about problems in multiple levels. At the highest level you re interested in the main ideas print the verses and chorus but you re not so concerned about the exact details. You use the same technique when you talk about your day I drove to work had some meetings went to lunch and taught a class. You don t usually describe each detail of each task. Each major task can be broken down into its component tasks later. If somebody asks you could really describe the meeting I got some coffee appeared to be taking notes furiously on my PDA got a new high score on Solitaire while appearing to take notes scribbled on the agenda and dozed off during a presentation. Returning a Value The chorus Function Another interesting thing about the code s main section code is the use of the print function. In the last program I simply said chorus and the program printed the verse. In this program I did it a little differently. The chorus function doesn t actually print anything to the screen. Instead it creates the chorus as a big string and sends that value back to the program which can do whatever it wants with it. This behavior isn t new to you. Think about the rand function. It always returns a value to the program. The functions in this program work the same way. Take another look at the chorus function to see what I mean function chorus output HERE .with a knick-knack br paddy-whack br give a dog a bone br this old man came rolling home br br br HERE return output end chorus Chapter 3 Controlling Your Code ith Conditions and Functions 84 PHP 5 MySQL Programming for the Absolute Beginner I began the function by creating a new variable called .

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.