Skip to content

er-hiba/Simple-PHP-Array-Exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This repository contains a collection of simple PHP exercises focusing on arrays. Each exercise is designed to demonstrate different array manipulation techniques and basic programming concepts in PHP.

Scripts:

♡   ex1 : Initializes an array with 10 elements, each set to 0, and displays it.
♡   ex2 : Initializes an empty array and inserts the vowels at the beginning using the array_splice() function.
♡   ex3 : Creates a form to input 10 numbers and calculates their sum, average, and product using PHP.
♡   ex4 : Calculates the dot product of two vectors and displays the result.
♡   ex5 : Creates a form to input 10 numbers and finds the minimum and maximum values using PHP.
♡   ex6 : Creates a form to input 10 numbers, stores them in an array, and saves the array in a session variable. It then displays another form that allows users to input a number to check if it exists in the array, and displays the result.
♡   ex7 : Creates a form to input 10 numbers, stores them in an array, and saves the array in a session variable. It then displays another form that allows users to input a number to check the number of occurrences of that number in the array, and displays the result.
♡   ex8 : Creates a form to input the grades of 10 students, stores them in an array, calculates the class average, and counts the number of grades above the average. Displays the grades as an array, the class average, and the number of grades above the average.
♡   ex9 : Takes an array, reverses it, and displays both the original and reversed arrays.
♡   ex10 : Creates a form to input a positive integer and checks if the input number is prime, then displays the result.