The returned string seems to respond to a specific pattern:
First there is a series of 6 numbers then there is the word "SECTOR" followed by a number and to end a string that represents the full name.
Starting from the basis that this pattern will always be followed and assuming that there will be other more complete solutions to this problem, I propose an approach to the desired solution.
To solve it, I used regular expressions to separate the data from the string in the observed patterns, so we get this data:
id, sector, nombre completo
The name is impossible to divide by name and surname following this strategy.
The strategy is as follows:
We separate the string into substrings using the id as the delimiter (attainment of 6 numbers)
For each substring: we separate using the sector that is composed of the word "SECTOR" plus a number.
assemble the array with the results.
The code would be more or less like that.
CODE:
<?php
//Partiendo del array devuelto por el Webservice
$array['any'] = '210819SECTOR1ALVAREZSAEZROBERTOALEJANDRO210950SECTOR1BOBADILLASILVAGLORIAJIMENA210968';
//Separamos la cadena por el id del usuario que responde al patrón de una consecución de 6 números
preg_match_all("/[0-9]{6}[A-Z]+[0-9]{1}[A-Z]+/u", $array['any'], $array);
/* ahora $array contiene esto:
Array
(
[0] => Array
(
[0] => 210819SECTOR1ALVAREZSAEZROBERTOALEJANDRO
[1] => 210950SECTOR1BOBADILLASILVAGLORIAJIMENA
)
)*/
$datos = [];
$persona = [];
foreach ($array[0] as $datos) {
//Separamos el id del cliente
preg_match("/[0-9]{6}/u", $datos, $id);
$persona['id'] = $id[0];
//separamos el sector al que pertenece
preg_match("/SECTOR[0-9]{1}/u", $datos, $sector);
$persona['sector'] = $sector[0];
//Separamos el nombre competo utilizando como delimitador el sector
$nombre = preg_split("/SECTOR[0-9]{1}/u", $datos);
$persona['nombre'] = $nombre[1];
//Lo añadimos al array de personas
$personas[] = $persona;
}
//Este array contiene un array por cada uno de los clientes devueltos
print_r($personas);
RESULT:
Array (
[0] => Array
(
[id] => 210819
[sector] => SECTOR1
[nombre] => ALVAREZSAEZROBERTOALEJANDRO
)
[1] => Array (
[id] => 210950
[sector] => SECTOR1
[nombre] => BOBADILLASILVAGLORIAJIMENA
)
)
Note:
I'm not an expert in regular exprexiones, I suppose you can improve.