Question
PHP The file classList.txt should be copied into the www directory. Use the file() function to read in this file as an array of string,
PHP
The file classList.txt should be copied into the www directory. Use the file() function to read in this file as an array of string, each string containing a line of the file. Note that the strings in the array will still have the newline at the end. If you want to remove the , use the trim() function. To determine if EECS is in the line, use the explode() func to break the string into an array containing the students name, email, degree studied (EECS, MATH, or BIZ), and year. Use the in_array() function to determine if EECS is present in the array. If it is found in the array, then use the highlight class defined in the CSS to make the text in this paragraph highlighted.
ini_set('display_errors', 1); # only need to call these functions error_reporting(E_ALL); # one time ?>
Lab 4
by john
Task 1: While loop
Simulate multiple dice rolls until a 6 is reached. Print out the results of each roll.
?>
Task 2: Array, for-loop, string function
Create an array of strings that is made up of 10 words with the first letter capitalized. Your strings can be of any words you want. Print out these words in a table, where the first column is the word in the array and the second column are the same words in all uppercase. You should use a the rows of the table.
'); foreach($list as $item) { $upper = strtoupper($item); print("
Task 3: Files, arrays, and for-loops
This task is to read in the contents of the file classList.txt
in to PHP. Then, you should print out each line from the file as a paragraph element. If the line contains the string "EECS", print this out using highlight. See the CSS file for the class name for highlight (you can also view the source of this document to see example of the HTML output).
?>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started