PHP example: Webzine editing and sending 2. In the previous PHP example, edit and send Webzine (1) list 3: Create an HTML table $ anchor );}? This table starts and ends in HTML mode, but most of the intermediate processes are in PHP mode. in the previous PHP example, edit and send Webzine. (1) list 3: Create an HTML table.
$ Anchor") ;}?> This table starts and ends in HTML mode, but most of its intermediate processes are in PHP mode. Now we will analyze this example line by line. It starts in HTML mode (this is the normal start mode of PHP ). The border width of the table is 1: Now, switch to the PHP mode:
$ Anchor"); The following echoe statement inserts the specified string into the output stream (that is, the body of the HTML webpage. Therefore, you can use this statement to insert the entire table row. You can use "to insert a quotation mark character in a string. The $ color and $ anchor variables calculated above are automatically substituted into their reference locations: echo ("
$ Anchor "); For loop end:} returns the HTML mode from the PHP mode again:?> The end of the HTML table in the category menu: the analysis of the program creation process ends here! Once a story is selected, you need to print the body of the story from the story file to the current web page. (Edit the Module author. php3 to prepare the story in the correct HTML format .) This is a simple process. In the following code segment, assume that the story number is stored in the variable $ story. If $ story is 33, the story file is s33.txt. $ Storyfile = fopen ("s‑story.txt", "r"); fpassthru ($ storyfile); in the preceding example, the fopen function opens a file and returns a handle to the file, then, store the handle in the variable $ storyfile using the value assignment operator. The fpassthru function copies the file content to the current output device (output HTML file) and closes the file automatically. Content notice this article (part 1) introduces the first part of Webzine, a simple PHP application, and analyzes several small sample codes in detail. (This part of the code size of the application is only 2 K, so there are not many large code examples for us to choose !) This should allow you to have a good experience with the powerful functions of PHP, but there is still more content in the future. The next section is roughly the same as the previous section. I will explain how the story menu is presented to the reader to complete the discussion on the sending module. Then I will discuss the editing module that allows the author to submit the story. Although the editing module is much larger than the sending module, we will not discuss it in such detail: we only need to explain the interesting concepts different from the sending module. Reference Resource PHP.net is the official homepage of PHP language. You can download the latest PHP version for free and view the development trend of PHP. There is also a FAQ, a manual, and many other resources. PHPbuilder.com is intended for developers, including a large number of articles and code samples, zero-active registration, and links to PHP resources. The PHP section of Webmonkey contains a large number of entry-level articles about PHP.
Create an HTML table $ anchor);}?> This table starts and ends in HTML mode, but most of its intermediate processes are in PHP mode...