For Web programming, the most important thing is to access and read and write data. There may be many ways to store them, such as strings, arrays, files, and so on. arrays, which can be said to be a more important way of using PHP data. PHP's Array
1, the definition and initialization of character arrayThe easiest way to understand the initialization of a character array is to assignments each element of the array in one word.Char str[10]={' I ', ', ' a ', ' m ', ', ' h ', ' A ', ' P ', ' P ',
arrays, which can be said to be a more important way of using PHP data. PHP's Array function is numerous, below is my study summary, takes this to remember, facilitates later to learn.
1. Array definition
The definition of an array is defined using
PHP's Array function is numerous, below is my study summary, takes this to remember, facilitates later ...
one, array definition:The definition of an array is defined using the array () method, and an empty array can be defined:
. Foreach Traversal:
Use the typedef statement to define the array type
1. Definition Format of one-dimensional array type
Typedef [];
For example:
(1) typedef int vector [10];
(2) typedef char strings [80];
(3) typedef short int array [N];
The first statement
To define an array type using typedef statements1. Defining formats for one-dimensional array types typedef []; For example: (1) typedef int VECTOR[10]; (2) typedef char STRINGS[80]; (3) typedef short INT array[n]; The first statement defines an
1. Definition Format of one-dimensional array typeTypedef [];For example:(1) typedef int vector [10];(2) typedef char strings [80];(3) typedef short int array [N];The first statementDefines an array type vector whose element type is int and
C + + character arrayThe array used to hold the character data is an array of characters, and one of the elements in the character array holds one character. A character array has a common attribute of an array. Because of the wide range of string
For Web programming, the most important thing is to access and read/write data. There may be many storage methods, such as strings, arrays, and files. Array is an important method in PHP Data applications. PHP has a large number of array functions.
How to define an array: There are two main ways to create an array in PHP, so let's look at how to create an array
(1) Create an array of methods for assigning values directly to each element.
The format is: $arrayname [Key]=value;
Where
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.