Tag Archives: php convert

PHP : Deleting Duplicates From An Array

Hey Folks, PHP’s array_unique function allows you to remove duplicate values from an array. Syntax: Note : The keys are preserved. array_unique() sorts the values treated as string at first, then will keep the first key encountered for every value, and ignore all following keys. It does not mean that the key of the first […]

Convert a string to an array using str_split PHP function.

Hey Folks, In PHP, You can convert a string to an array using str_split function. Syntax: Example: Return Values: If the optional split_length parameter is specified, the returned array will be broken down into pieces with each being split_length in length, otherwise each piece will be one character in length. FALSE is returned if split_length […]