I have a script that outputs my data like this YH1H-BJ-YD35-0Y12Y8-102Y0Y Each output is random How can I make that look like this YH1H/-BJ-/YD35/-0Y12/Y8-/102Y/0Y
There's probably a regular expression that will do it easily but you can always use explode('-',$str) to get the bits and then just rebuild it from the array.
We are going to need more information. One would think that all dashes have a slash preceding them or superceding them. Was this a mistake or intentional: (I don't see a dash- in which case if it was intentional we need to know how we find out where slashes go before we can manipulate the original string)
YH1H/-BJ-/YD35/-0Y12/Y8-/102Y/0Y was intentional I need the / in the same spots as this example for all the output data example of output data AH1H-BJ-YD35-0Y12Y8-102Y0Y BH1H-BJ-HD35-0Y1HY8-102H0U example of what I need AH1H/-BJ-/YD35/-0Y12/Y8-/102Y/0Y BH1H/-BJ-/HD35/-0Y1H/Y8-/102H/0U
Your dashes are random and not following a pattern therefore I cannot help you unless you want to do regex.