7. How PHP Works: When a user navigates her browser to a page that ends with a .php extension, the request is sent to a web server, which directs the request to the PHP interpreter. The PHP interpreter processes the page, communicating with file systems, databases, and email servers as necessary, and then delivers a web page to the web server to return to the browser.
15. A PHP scripting block can be placed anywhere in the document.
16. On servers with shorthand support enabled us to start a scripting block with <? and end with ?>.
17. For maximum compatibility, it is recommended that to use the standard form ( <?php ) rather than the shorthand form.
18.
19. The semicolon is a separator and is used to distinguish one set of instructions from another.
20. There are two basic statements to output text with PHP:
21. In the eg we have used the echo statement to output the text "Hello World".
22. Note : The file must have a .php extension. If the file has a .html extension , the PHP code will not be executed. echo and print
23. Comments in PHP: In PHP, we use // to make a single-line comment or /* and */ to make a large comment block. <html><body> <?php -> Single-line Comment -> Large Comment ?> </body></html> //This is a comment /* This is a comment block */
24.
25.
26. This enables easy administration in the way that administer Apache web server using configuration files.
27. The Settings in which upload directory, register global variables, display errors, log errors, max uploading size setting, maximum time to execute a script and other configurations is written in this file.
28. When PHP Server starts up it looks for PHP.ini file first to load various values for settings.
34. The parse_ini_file() function parses a configuration (ini) file and returns the settings in it in an array. Syntax: parse_ini_file(file,process_sections) file Required. Specifies the ini file to check process_sections Optional. If set to TRUE, it returns is a multidimensional array with section names and settings included. Default is FALSE
35. This function can be used to read in your own application's configuration files, and has nothing to do with the php.ini file. The following reserved words must not be used as keys for ini files: null, yes, no, true, and false. There are also some reserved characters that must not be used in the keys: {}|&~![()". Contents of "test.ini": [names] me = Robert you = Peter [urls] first = "http://www.example.com" second = "http://www.w3schools.com"
36. PHP code: <?php print_r(parse_ini_file("test.ini")); ?> The output of the code above will be: ( [me] => Robert [you] => Peter [first] => http://www.example.com [second] => http://www.w3schools.com )