TAILIEUCHUNG - Beginning PHP5, Apache, and MySQL Web Development split phần 2

Giả sử bạn quyết định bạn thực sự không muốn ngày được hiển thị với số không hàng đầu thế giới. May mắn thay, PHP có một giải pháp cho rằng khi định dạng các chức năng ngày. Trong ví dụ này, giá trị và hiển thị của nó là giống hệt nhau, nhưng trong một hệ thống cơ sở dữ liệu điều khiển, | Chapter 2 -----Simpo PDF Merge and Split Unregistered Version - http How It Works When PHP comes across an include line in a script it stops working on the current program and immediately shoots on over to whatever file it s told to include. The server parses that second file and carries the results back to the original file where the parsing continues from where it left off. Suppose you decided you didn t really want the date to be shown with the leading zeros. Luckily PHP has a solution for that when formatting the date function. Make the following change to your file and see what happens div align center font size 4 Welcome to my movie review site font br php echo Today is echo date F j echo echo date Y div Your problem is fixed and it s fixed in all the pages in your site in one fell swoop. Using Functions for Efficient Code As with includes functions make your code and your typing more efficient and easier to debug. Functions are blocks of code that can be called from anywhere in your program. They enable you to execute lines of code without having to retype them every time you want to use them. Functions can help set or update variables and can be nested. You can also set a function to execute only if a certain criterion has been fulfilled. Functions are mini-programs within themselves. They don t know about any other variables around them unless you let the other variables outside the function in through a door called global. You use the global varname command to make an outside variable s value accessible to the function. This does not apply to any values assigned to any variables that are global by default such as _POST _GET and so on. Your function can be located anywhere within your script and can be called from anywhere within your script. Therefore you can list all your commonly used functions at the top of your program and they can all be kept together for easier debugging. Better yet you can put all your functions in a .

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.