Home  >  Article  >  Backend Development  >  How to add, delete, check and modify PHP array

How to add, delete, check and modify PHP array

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-09-28 12:01:233013browse

How to add, delete, check and modify PHP array

First we need to write an array using our sublime.

How to add, delete, check and modify PHP array

Let’s use dump to see the effect.

How to add, delete, check and modify PHP array

How to add, delete, check and modify PHP array

##Related recommendations: "

php array"

Let’s take a look at how to add one Data, the first thing we need to do is use $a['d']=4;.

How to add, delete, check and modify PHP array

How to add, delete, check and modify PHP array

Then let’s look at how to modify the data. We can directly use $a['b']=5 to modify it.

How to add, delete, check and modify PHP array

How to add, delete, check and modify PHP array

Then let’s look at how to delete elements in the array, use unset($a['d']); delete.

How to add, delete, check and modify PHP array

The last step is how to search. To search, we directly use echo and key-value pairs to search directly.

How to add, delete, check and modify PHP array

The above is the detailed content of How to add, delete, check and modify PHP array. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn