Basic Array Functions in PHP
Submitted by nurhodelta_17 on Friday, August 25, 2017 - 13:37.
In this tutorial, I'm going to show you the basic functions in working with array in PHP. I'm going to post tutorials about arrays, so this tutorial is the starting line. An array is a data structure that stores one or more values into a single value. It is useful in defining large number of variables like having 50 variables. Instead of declaring 50 of them, you can store this 50 values into a single variable.
Creating our Functions
The first and last step is to create our page with our functions. I've also included in the comments the definition of each function. To create the page, open your HTML code editor and paste the code below after the tag.- <!DOCTYPE html>
- <html>
- <head>
- <title>Basic Array Functions in PHP</title>
- </head>
- <body>
- <?php
- ?>
- //Determines the number of elements in array
- //Determines the maximum value in array
- //Determines the minimum value in array
- //Sorting array in ascending order
- //Sorting array in descending order
- //Joining array elements with a string
- <?php $name="N E O V I C"; ?>
- //Separates a string via specified string
- //Returnns true if a value is found in array
- </body>
- </html>
Add new comment
- 60 views