tailieunhanh - Phát triển web với PHP và MySQL - p 5

PHP Crash Course CHAPTER 1 15 Different tag styles are available. This is the short style. If you have some problems running this script, it might be because short tags are not enabled in your PHP installation. Let’s look at this in more detail. 1 PHP CRASH COURSE PHP Tag Styles There are actually four different styles of PHP tags we can use. Each of the following fragments of code is equivalent. • Short style Order processed.”; ? This is the tag style that will be used in this book. It is the default tag that PHP developers use to code PHP. This style of tag is the. | PHP Crash Course Chapter 1 15 Different tag styles are available. This is the short style. If you have some problems running this script it might be because short tags are not enabled in your PHP installation. Let s look at this in more detail. PHP Tag Styles There are actually four different styles of PHP tags we can use. Each of the following fragments of code is equivalent. Short style echo p Order processed. This is the tag style that will be used in this book. It is the default tag that PHP developers use to code PHP. This style of tag is the simplest and follows the style of an SGML Standard Generalized Markup Language processing instruction. To use this type of tag which is the shortest to type you either need to enable short tags in your config file or compile PHP with short tags enabled. You can find more information on how to do this in Appendix A. XML style php echo p Order processed. This style of tag can be used with XML Extensible Markup Language documents. If you plan to serve XML on your site you should use this style of tag. SCRIPT style SCRIPT LANGUAGE php echo p Order processed. SCRIPT This style of tag is the longest and will be familiar if you ve used JavaScript or VBScript. It can be used if you are using an HTML editor that gives you problems with the other tag styles. ASP style echo p Order processed. This style of tag is the same as used in Active Server Pages ASP . It can be used if you have enabled the asp_tags configuration setting. You might want to use this style of tag if you are using an editor that is geared towards ASP or if you already program in ASP. PHP Statements We tell the PHP interpreter what to do by having PHP statements between our opening and closing tags. In this example we used only one type of statement 1 PHP Crash Course echo p Order processed. 16 Using PHP Part I As you have probably guessed using the echo construct has a very simple result it prints or echoes the string passed to it to the browser. In Figure .

TỪ KHÓA LIÊN QUAN