Does PHP have built-in data structures?

后端 未结 14 1194
名媛妹妹
名媛妹妹 2021-01-30 00:18

I\'m looking at the PHP Manual, and I\'m not seeing a section on data structures that most languages have, such as lists and sets. Am I just blind or does PHP not have anything

14条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 00:36

    C languages will allow creating a structure and then filling it like a string (char/byte) buffer. Once it's filled the code accesses the buffer via the structure members. It's really nice to parse structured (database,image,etc.) files that way. I don't think you can do that with PHP structures - or am I (hopefully) wrong.

    Ok - well PHP does have unpack and pack - functionally the same, but not as elegant.

提交回复
热议问题