PHP Array Function Example

Mar 01, 2021



Hello Friends,

Now let's see example of how to use array in php function. This is a short guide on php if array function. We will use array function in php. PHP provides various array functions to access and manipulate the elements of array. PHP array() function creates and returns an array. It allows you to create indexed, associative and multidimensional arrays.

Here i will give you example of how you can check array function in php file.

Syntax 1 for indexed arrays:

array(value1, value2, value3, etc.)

Syntax 2 for associative arrays:



<!DOCTYPE html>



<title>Array Function in PHP -</title>




echo "I like " . $cars[0] . ", " . $cars[1] . " and " . $cars[2] . ".";




I like Volvo, BMW and Toyota.

It will help you....

#PHP 8