How to Understand PHP is mainly a language for operating Arrays

Source: Internet
Author: User
How to Understand PHP is mainly a language for operating arrays, or how to properly use arrays? How to Understand PHP is mainly a language for operating arrays, or how to properly use arrays?

Reply content:

How to Understand PHP is mainly a language for operating arrays, or how to properly use arrays?

A dedicated data structure solution is available in strong programming languages. Generally, a container is created to store any type of data in the container, and the container capacity can be determined based on the data stored in the container, hitting the variable-length container structure, for example, linked lists, stacks, and queues are common forms in data structures.In PHP, arrays are usually used to complete the work that can be completed only when data structures are used in other languages.

The Lord, who told you that PHP is the main language used to operate arrays, PHP cannot do anything without leaving the database, and those who mislead you are hateful.

The author's question is a misunderstanding. I don't think PHP is "mainly a language for operating arrays"
1. The cause of this misunderstanding may be that the PHP array can be summarized as a key-Value Pair array. Unlike other languages, you need to distinguish between linked lists, dictionaries, and index arrays.
2. If "mainly a language for operating arrays" is set up, other languages are also set up. In addition to Operation arrays, they also operate on strings and operations.
3. In my opinion, whether in PHP or other languages, it must beData Structure+AlgorithmLanguage. Therefore, we use arrays to describe the data structure, object-oriented to describe the data structure, or strings (such as json and xml) to describe the data structure. Yes.

This may be an alternative to PHP's powerful array functions.

Every language has the concept of an array. How can we say that php is a language mainly used to operate arrays? It can only be said that the array is flexible and powerful, and it is only one of the php data types. Python also has its list, ancestor, and dictionary.

The php array is very powerful, but it seems a bit...

The PHP array makes it easy for us to Reasonably organize the data structure. PHP can do a lot of things. You can look at the swoole PHP extension.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.