This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a collection of working solutions in PHP found all over internet to check two things: | |
1. Whether a given variable is an indexed array. An indexed array in PHP is an array where all keys are sequential, numerical and starts from 0, ie, which is like vector in other languages. The tests can be found here: https://3v4l.org/fcZ2j | |
2. Whether a given variable is an associative array. An associative array is the opposite of above case where keys need not be numeric, sequential or starting from zero. The tests can be found here: https://3v4l.org/fcZ2j |