TAILIEUCHUNG - PHP and MySQL Web Development - P15

PHP and MySQL Web Development - P15: 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. | Precedence and Associativity Evaluating Expressions 37 Precedence and Associativity Evaluating Expressions In general operators have a set precedence or order in which they are evaluated. Operators also have an associativity which is the order in which operators of the same precedence will be evaluated. This is generally left to right called left for short right to left called right for short or not relevant. Table shows operator precedence and associativity in PHP. In this table the lowest precedence operators are at the top and precedence increases as you go down the table. Table Operator Precedence in PHP Associativity left left left left right left left left left left left left n a n a left left left right right n a n a Operators or xor and print - . A A - . -- int double string array object @ new Notice that the highest precedence operator is one we haven t covered yet plain old parentheses. The effect of these is to raise the precedence of whatever is contained within them. This is how we can work around the precedence rules when we need to. 38 Chapter 1 PHP Crash Course Remember this part of the last example totalamount totalamount 1 taxrate If we had written totalamount totalamount 1 taxrate the multiplication operator having higher precedence than the addition operator would be performed first giving us an incorrect result. By using the parentheses we can force the sub-expression 1 taxrate to be evaluated first. You can use as many sets of parentheses as you like in an expression. The innermost set of parentheses will be evaluated first. Variable Functions Before we leave the world of variables and operators we ll take a look at PHP s variable are a library of functions that enable us to manipulate and test variables in different ways. Testing and Setting Variable Types Most of these functions have to do with testing the type of a function. The two most general are gettype and settype .These have the following function prototypes .

TỪ KHÓA LIÊN QUAN
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.