TAILIEUCHUNG - Beginning PHP and Postgre SQL 8 From Novice to Professional phần 2

Thông thường, bạn sẽ muốn thực hiện một số nhiệm vụ khi tạo và phá hủy các đối tượng. Ví dụ, bạn có thể muốn ngay lập tức chỉ định một số lĩnh vực của một đối tượng mới được khởi tạo. Tuy nhiên, nếu bạn phải làm như vậy bằng tay, bạn gần như chắc chắn sẽ quên | 58 CHAPTER 3 PHP BASICS An identifier can consist of one or more characters and must begin with a letter or an underscore. Furthermore identifiers can consist of only letters numbers underscore characters and other ASCII characters from 127 through 255. Consider a few examples Valid Invalid my_function This that Size counter someword 4ward Identifiers are case-sensitive. Therefore a variable named recipe is different from a variable named Recipe rEciPe or recipE. Identifiers can be any length. This is advantageous because it enables a programmer to accurately describe the identifier s purpose via the identifier name. An identifier name can t be identical to any of PHP s predefined keywords. You can find a complete list of these keywords in the PHP manual appendix. Variables Although variables have been used within numerous examples found in this chapter the concept has yet to be formally introduced. This section does so starting with a definition. Simply put a variable is a symbol that can store different values at different times. For example suppose you create a Web-based calculator capable of performing mathematical tasks. Of course the user will want to plug in values of his choosing therefore the program must be able to dynamically store those values and perform calculations accordingly. At the same time the programmer requires a user-friendly means for referring to these value-holders within the application. The variable accomplishes both tasks. Given the importance of this programming concept it would be wise to explicitly lay the groundwork as to how variables are declared and manipulated. In this section these rules are examined in detail. Note A variable is a named memory location that contains data and may be manipulated throughout the execution of the program. Variable Declaration A variable always begins with a dollar sign which is then followed by the variable name. Variable names follow the same naming rules as identifiers. That is a variable name .

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.