Sample model Question for array, strings, PHP programs, Database connectivity, GIT
connectivity
1. Write a PHP script to:
a) find length of string : hello
b) transform a string to all uppercase letters.
c)transform a string to all lowercase letters.
d)reverse the given string :hello
e)concatenate the given string :Hello and World
2. Develop a PHP program to demonstrate various array operations for the given array
$employees with the elements "Ravi", "Anitha", "Suresh", "Lakshmi", "Vijay". Perform
the following operations in sequence and display the output after each step:
Access and display all the elements of the array
Update the 2nd element "Anitha" to "Anu"
Add a new employee name "Karthik" to the array
Remove the employee name "Suresh" from the array
Sort the final array in alphabetical (ascending) order
3. Write a PHP script which will display the following string by applying appropriate text
colors using the given array.
“Learning never exhausts the mind. Simplicity is the ultimate sophistication. Art is never
finished, only abandoned.” – Leonardo da Vinci
Use the following array:
$color = array('purple', 'orange', 'brown', 'blue', 'black');
4. Develop a PHP program to get registration details from student database and return that
data using POST method in separate PHP file.
5. Develop a PHP web application to collect student details and store them in a database.
The form should contain the following input fields: Student Name,Register
Number,Email ID,Course,Year of Study. In addition, the form should allow the user to
upload a student ID proof/photo. When the form is submitted, the following actions must
take place:
a. The student details must be inserted into a table named students in the
database college_db.
b. The uploaded file should be stored in a folder named uploads/ on the
server.
c. The uploaded file name must be saved in the database along with the
student details
6. Develop a PHP program to create a simple hospital management system with MySQL
that performs all CRUD operations.
7. Develop a PHP program to create an employee database system with MySQL that
performs all CRUD operations.
8. Write a git command to perform the following actions in git.
● Create a global and local repository
● Add file to staging environment
Sample model Question for array, strings, PHP programs, Database connectivity, GIT
connectivity
● Save the files in staging environment to local repository
● Move the file from local to global repository
● Move the file from global to local repository
9. Write the GIT commands to connect local git to global repository.
10. Two branches make conflicting changes to a repository:
Both branches modify the same line in a [Link] branch deletes a file while another
branch modifies the same [Link] concurrent changes cannot be merged automatically
by Git. Explain how Git reports merge conflicts in the above scenarios and demonstrate
the step-by-step process to resolve these conflicts using Git commands and comments.
11. Write down the Git commands for performing the following operations:
Move all the files that you have created for designing the website into global repository
Create a new branch in local repository
Make changes for the website in the new branch (local repository)
Merge the changes in the master branch.(local repository)
Updated it in global repository
Make changes to the website in global repository
Updated it to the local repository