TAILIEUCHUNG - Professional Information Technology-Programming Book part 62

Tham khảo tài liệu 'professional information technology-programming book part 62', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Understanding Variables Variablescontainers in which values can be stored and later retrievedare a fundamental building block of any programming language. For instance you could have a variable called number that holds the value 5 or a variable called name that holds the value Chris. The following PHP code declares variables with those names and values number 5 name Chris In PHP a variable name is always prefixed with a dollar sign. If you remember that declaring a new variable is very easy You just use an equals symbol with the variable name on the left and the value you want it to take on the right. Declaring Variables Unlike in some programming languages in PHP variables do not need to be declared before they can be used. You can assign a value to a new variable name any time you want to start using it. Variables can be used in place of fixed values throughout the PHP language. The following example uses echo to display the value stored in a variable in the same way that you would display a piece of fixed text name Chris echo Hello echo name The output produced is Hello Chris Naming Variables The more descriptive your variable names are the more easily you will remember what they are used for when you come back to a script several months after you write it. It is not usually a good idea to call your variables a b and so on. You probably won t remember what each letter stood for if anything for long. Good variable names tell exactly what kind of value you can expect to find stored in them for example price or name . Case-Sensitivity Variable names in PHP are case-sensitive. For example name is a different variable than Name and the two could store different values in the same script. Variable names can contain only letters numbers and the underscore character and each must begin with a letter or underscore. Table shows some examples of valid and invalid variable names. Table . Examples of Valid and Invalid Variable Names Valid Variable Names Invalid .

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.