A FUNCTION block statement is used to create a function procedure to return a calculated value to a program.
https://www.php.net/manual/en/function.explode.php
How many elements are you giving your array when you declare it? The reason REDIM was used in the version I gave you is because of dynamic sizing.