The php-demo repository contains a simple PHP script that generates an array of five random numbers, prints the array, and calculates various statistics about it.
- Generates an array of five random numbers between 1 and 10.
- Prints the generated array.
- Calculates and displays:
- The number of elements in the array.
- The sum of all elements in the array.
- The product of all elements in the array.
- The frequency count of each element in the array.
To run this script, you need a local server environment that supports PHP. You can use XAMPP, WAMP, or MAMP for development purposes.
-
Clone the repository to your local machine:
git clone https://github.com/yourusername/php-demo.git
-
Navigate to the project directory:
cd php-demo -
Place the
page1.phpfile in your web server's document root (e.g.,htdocsfor XAMPP).
To use this script, simply open a web browser and navigate to the URL where you placed the page1.php file. For example:
http://localhost/php-demo/page1.php
You should see the generated array and various statistics displayed on the page.
- PHP 7.x or later
This project is licensed under the MIT License - see the LICENSE file for details.