một trong số đó là thư viện GD của Boutell (GD SDK). SDK GD cho phép bạn tạo ra và thao tác hình ảnh trên bay, mà tôi cho là rất quan trọng trong sự phát triển của trò chơi. Nếu bạn muốn cài đặt các module khác, cảm thấy miễn phí. Đa số các cài đặt là rất giống nhau. Hãy cho nó! | 60 Chapter 4 Say Hello to PHP Those are just a few of the prefixes I use. Again you don t have to use them at all but I do recommend that you come up with some sort of naming convention. It really does help out when you come back to a piece of code after a while or when someone else is reading your code. As you may have noticed it is nothing more than Hungarian notation. If you are familiar with Windows programming then you are probably very comfortable with Hungarian notation. Functions for Variables Now you know what types of variables PHP can handle and how to use the majority of them. I will cover objects and arrays later on. Now take a look at the built-in functions that PHP gives us for working with variables. gettype gettype determines that data type of a variable. gettype returns a string. Possible return values for gettype are integer double string array object and unknown type and since PHP 4 Boolean resource and NULL . if gettype somevar string echo somevar settype settype explicitly sets the data type of a variable. The type is passed in as a string. Possible values are integer double string array or object. If the type is successfully set then settype returns true otherwise it returns false. If settype somevar integer echo Successfully set the type to a integer isset isset is used to determine whether a variable has been given a value. If the variable has been given a value then isset returns true otherwise it returns false. if isset somevar echo The variable has a value Functions for Strings 61 unset unset is used to unset a variable or destroy it. This essentially frees all the memory that is associated with that variable. unset somevar if isset somevar echo This text will never print empty empty is the exact opposite of the isset function. It will return true if the variable has not been set and false if it has been set. This would be the same as saying if isset somevar is_datatype is_int is_integer and is_long all do exactly the same thing. They .