PHP Arrays

Back to ACP page

Table of Contents

PHP Array Types

In PHP, there are three types of arrays:

Working With Arrays

In this tutorial you will learn how to work with arrays, including:

PHP 1 Array Items

<h4>Array_Items</h4> <p></p> <?php // function example: function myFunction() { echo "This text comes from a function"; } // create array: $myArr = array("Volvo", 15, ["apples", "bananas"], myFunction() ); // calling the function from the array item: $myArr[3](); ?>

Example 1

Result View Example

PHP 2 Array Functions

<h4>Array_Functions</h4> <?php $cars = array("Volvo", "BMW", "Toyota"); echo count($cars); ?>

Example 2

Result View Example

Document

Document in project

You can Download PDF file.

Reference