What are Arrays? (In Programming Language)



What are Arrays?-It is very important to understand what is Array?. When you are learning or starting to get into the world of programming, because this is the basis when creating a program. Then, what exactly is Arrayy? How often is it used when we make a computer program? You will find the answer in this article. Just take a look at the following reviews!

What is Array in programming language?

Array in PHP is a type of data structure that allows us to store multiple elements of the same data type under one single variable. So it can save our efforts to create different variables on each data. Arrays really help us to create a list of elements of the same type, which can be accessed using an index or key.array.

Suppose we want to save five names and then print the five names. We can do this by using five different string variables. But what if we want to use hundreds of names? then we will definitely find it difficult to create a variable that is different from hundreds of names.

This is where arrays come into play and also helps us to store each element in a single variable and allow easy access using an index or key.

array
array

Types of Arrays in programming languages

1. Arrays with One Dimension

Arrays with one dimension are most often used, for example to list a number of people based on their age, the requirement that must be entered to determine an element is age.

2. Two-Dimensional Array

For example, you want to display data with the contents of the number of offices on each floor in each building, then the elements that must be used are the name of the building or the building and the number of floors in each building.

3. Arrays with Multiple Dimensions

The last type of Array is an Array with many dimensions, or usually more than two. Suppose is a three-dimensional Array, then the example case that you can use is a coordinate or a room: x, y, z.

Now that’s all I can discuss this time about what an array is, I hope you can understand and understand what an array is in a programming language.