This is my line
AQUA19097444,AQUA43188766,AQUA49556282,AQUA51389151,AQUA57267110,BLUE12811521,BLUE15966728
This is what I want to achieve in the end
AQUA 1909 7444,AQUA 4318 8766,AQUA 4955 6282,AQUA 5138 9151,AQUA 5726 7110,BLUE 1281 1521,BLUE 1596 6728
Notice there is space every 4 characters but does not include a space if a comma is next.
This is what I have tried so far: note I am in a for each loop
$Raffles[$index] = chunk_split($Raffles[$index], 4, ' ');
This is the output of the code
AQUA 1909 7444 ,AQU A431 8876 6,AQ UA49 5562 82,A QUA5 1389 151, AQUA 5726 7110 ,BLU E128 1152 1,BL UE15 9667 28
As you can see it does a space when It reaches the comma which I want it to ignore
Please help me out and thank you for reading my question.