Reference no: EM132224961
A. Code Prettification
- Find on the internet (or write in your favorite programming language!) a program that "prettifies" HTML code.
• That is, when a <TABLE ...> tag is encountered, a carriage-return is inserted (if needed) and the indent level should be increased on all subsequent code. When a </TABLE> is encountered, indent level should be reduced.
- Does the same for any other significant tags (e.g. <tr>, <div>, etc.)
• Returns, or saves the prettified code in a new file (e.g. result.htm)
(Note that multiple tags may occur on the same line; but you may assume that the code originally input does generate a valid webpage)
- Test on the following files:
• one of your choosing (Amazon, Facebook, etc.)
- Link to your code-prettifier solution from your hw.htm page
- Link to the resulting prettified pages of code, and include notes as to provenance of the original source code, and degree of improvement rendered by your solution
B. String Function Research and Documentation
Provide the interface (or function signature) for the following string functions (much like the first three items below, including optional parameters), and explain their use and what return-types are returned under different circumstances (Note: signature and return-type have been provided for the first three):
- int strlen(string $string)
- string strstr(string $haystack, $needle [, bool $B4needle = False])
- int strpos(string $haystack, $needle [, int $offset = 0]
- ??? substr(???);
- ??? substr_replace(???);
- ??? strcmp(???)
Have the function signatures link to a good page on the internet explaining that function's use. Type up the results of your research and save as an HTML document, and link to your hw.htm
C. Reading Assignment: Read CH5 from your assigned course textbook