Built in support for sets in PHP?
Just an idea, if you use the array keys instead of values, you'll be sure there are no duplicates, also this allows for easy merging of two "sets".
$set1 = array ('a' => 1, 'b' => 1, );
$set2 = array ('b' => 1, 'c' => 1, );
$union = $set1 + $set2;
Is there the equivent of a Java Set in php?
You could just use an array and put the data you want in the key because keys can't be duplicated.
Does PHP have built-in data structures?
The only native data structure in PHP is array. Fortunately, arrays are quite flexible and can be used as hash tables as well.
http://www.php.net/array
However, there is SPL which is sort of a clone of C++ STL.
http://www.php.net/manual/en/book.spl.php
Does PHP have a Set data structure?
Yes, you could use the array object and the array functions.
Basically, you could dynamically grow an array using the array_push function, or the $arrayName[] = ...
notation (where arrayName is the name of your array).
Related Topics
How to Deal with "Method Not Found in Class" Warning for Magically Implemented Methods
How to Get the Root Url of the Site
Typecasting VS Function to Convert Variable Type in PHP
PHP MySQL - Insert into Without Using Column Names But with Autoincrement Field
SQL - Insert and Catch the Id Auto-Increment Value
Get First Element in PHP Stdobject
How to Add Filter or Hook for "Woocommerce_Add_To_Cart"
Symfony 2.7 Cache:Clear Command Checks Every Database Connection
How to Avoid Request Entity Too Large 413 Error
PHP Warning: Unknown: Input Variables Exceeded 1000
Make Woocommerce Checkout Phone Field Optional Based on Shipping Country
Possible to View PHP Code of a Website