Question: QUESTION 3 [30 MARKS a) Write a PHP program to calculate the total mark from the variable Smarki and Smark2. Create a function called Cal
QUESTION 3 [30 MARKS a) Write a PHP program to calculate the total mark from the variable Smarki and Smark2. Create a function called Cal TotalMarks() by passing these variables to calculate the total marks . Declare Stotal as a global variable to display the total mark outside the function. [8 Marks] b) Write a PHP Program to find the length of a string and counts the number of words in a string [4 Marks) c) ) Write the PHP code to open and read the first line of a file called "webdictionary.txt". [6 Marks] d) [4 Marks] Describe the following file functions. i. fopen() ii. fclose() fgets() iv. file_exists() e) Write a PHP Code to create and display an associative array with the information shown as below in Figure 3. [8 Marks) Product Code : 1001 Product Name : Iphone 13 Number of Products available : 15 Product Code : 1002 Product Name : Samsung Note 20 Number of Products available: 10 Figure 3: output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
