Register|Login

Have a question? Click here to ask the community.

Tutorial 7 – Arrays

| In: 7. Arrays | 16,548 views

Video Tutorial

Part 1:


Part 2:


Video Source Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
// File Description: PHP - Array Tutorial
// First Method To Create Numeric Arrays
 
$arrayExample[0] = "Robert";
$arrayExample[1] = "<a href='https://www.thephpbasics.com'>ThePHPBasics.com</a>";
$arrayExample[2] = "John";
$arrayExample[3] = 9;
 
//Robert teaches basic PHP tutorials at ThePHPBasics.com
 
echo "$arrayExample[0] teaches basic PHP tutorials at $arrayExample[1]";
 
//John is 9 years old
 
echo "<br>";
echo "$arrayExample[2] is $arrayExample[3] years old";
 
// Second Method To Create Numeric Arrays
 
$arrayNum = array("76", "50", "45", "30", "23", "3938");
 
echo "<br>The number: $arrayNum[1]";
 
?>

Comment Form

You must be logged in to post a comment.