tailieunhanh - Beginning PHP 5.3 phần 4

Trong thực tế, và dưới đây ngay cả các nhà khai thác chuyển nhượng. Điều này có nghĩa là bạn phải cẩn thận khi sử dụng và. Ví dụ: $ x = false | | đúng sự thật; / / $ x là đúng x = false hoặc đúng sự thật; / / $ x là sai | Part II Learning the Language Exercises 1. Write a Calculator class that can store two values then add them subtract them multiply them together or divide them on request. For example calc new Calculator 3 4 echo calc- add Displays 7 echo calc- multiply Displays 12 2. Create another class CalcAdvanced that extends inherits from the Calculator class. CalcAdvanced should be capable of storing either one or two values ca new CalcAdvanced 3 ca new CalcAdvanced 3 4 CalcAdvanced should also add the following methods pow that returns the result of raising the first number the base to the power of the second number sqrt that returns the square root of the first number exp that returns e raised to the power of the first number Hint PHP contains built-in functions called pow sqrt and exp . 218 Part III Using PHP in Practice Chapter 9 Handling HTML Forms with PHP Chapter 10 Preserving State With Query Strings Cookies and Sessions Chapter 11 Working with Files and Directories Chapter 12 Introducing Databases and SQL Chapter 13 Retrieving Data from MySQL with PHP Chapter 14 Manipulating MySQL Data with PHP Chapter 15 Making Your Job Easier with PEAR Chapter 16 PHP and the Outside World Chapter 17 Generating Images with PHP Chapter 18 String Matching with Regular Expressions Chapter 19 Working with XML Chapter 20 Writing High-Quality .