Does PHP have built-in data structures?

后端 未结 14 1030
名媛妹妹
名媛妹妹 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:51

    For the Compulsory need of data structures please browse for the SPL(PHP Extensions). They are having data structures like heap,linked-list,.. etc...

    PHP not having the list and set data structures exactly. but they can achieved by array(with n Dimentions), that provide the multiple data with single cluster

    $variable = array(
      'one' => array(1,'char',3),
      'two' => explode("single", "Multiple strings"),
      'three' => all(9,'nine',"nine")
    );
    

    They are not exactly as list or set. But array can replace that. So no need to search for another data structures.

提交回复
热议问题