Divides the passed string into an array of sub-strings
Device + Agent
Sub-string of one or more separator characters
Array — the collection of sub-strings
This function takes a string as its first parameter and searches that string for the character or characters contained in the string passed as its second parameter. If it finds any of these separator characters, it divides the main string at the location(s) of those characters and places the resulting sub-strings into a new array which it returns.
If none of the separator characters are found, the function returns an array containing the source string as a single item.
Because split() is implemented as a function, it does not use dot syntax.
will yield the following array:
["a", "b", "c"]
instead generates an extra array element: an empty string triggered by the second of the paired forward slashes, ie.
["a", "", "b", "c"]