need some help with explode()
Posted: Sun Aug 28, 2016 4:57 pm
I have a string that may be formatted in one of the following ways:
XXXXX
XXXXX/Y
Z/XXXXX
Z/XXXXX/Y //not likely but possible
The exact length of characters is never set but the / will always be the separator.
I need to be able to get X and regardless how they enter the data.
If it was just the XXXX/Y I would return the -1 value but with the possibility of having the / in another location I am not sure how to do this.
XXXXX
XXXXX/Y
Z/XXXXX
Z/XXXXX/Y //not likely but possible
The exact length of characters is never set but the / will always be the separator.
I need to be able to get X and regardless how they enter the data.
If it was just the XXXX/Y I would return the -1 value but with the possibility of having the / in another location I am not sure how to do this.