In questo caso specifico, questo funziona:
<?php
$testo = 'sub0falsefalsechimerahttp://wso2.org/claims/username0falsefalsechimerahttp://wso2.org/claims/lastname0falsefalsechimeraurn:scim:schemas:core:1.0:meta.lastModified0falsefalse2017-01-21T00:11:34preferred_username0falsefalsechimeragiven_name0falsefalsechimeraurn:scim:schemas:core:1.0:userName0falsefalsechimerahttp://wso2.org/claims/fullname0falsefalsechimeraname0falsefalsechimeraurn:scim:schemas:core:1.0:id0falsefalse44540fb4-39cb-49ac-8157-70161699fa89urn:scim:schemas:core:1.0:meta.created0falsefalse2016-07-21T12:10:00family_name0falsefalsechimerahttp://wso2.org/claims/role0falsefalseutente,Internal/everyonehttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname0falsefalsechimeraurn:scim:schemas:core:1.0:name.familyName0falsefalsechimerafullname0falsefalsechimerahttp://axschema.org/namePerson/last0falsefalsechimera6730';
$cerca = strstr($testo, 'utente');
$cercaExpl = explode(',', $cerca);
echo $cercaExpl[0];
se però c'è un'altra virgola, salta tutto.
sennò balmente:
$testo = 'sub0falsefalsechimerahttp://wso2.org/claims/username0falsefalsechimerahttp://wso2.org/claims/lastname0falsefalsechimeraurn:scim:schemas:core:1.0:meta.lastModified0falsefalse2017-01-21T00:11:34preferred_username0falsefalsechimeragiven_name0falsefalsechimeraurn:scim:schemas:core:1.0:userName0falsefalsechimerahttp://wso2.org/claims/fullname0falsefalsechimeraname0falsefalsechimeraurn:scim:schemas:core:1.0:id0falsefalse44540fb4-39cb-49ac-8157-70161699fa89urn:scim:schemas:core:1.0:meta.created0falsefalse2016-07-21T12:10:00family_name0falsefalsechimerahttp://wso2.org/claims/role0falsefalseutente,Internal/everyonehttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname0falsefalsechimeraurn:scim:schemas:core:1.0:name.familyName0falsefalsechimerafullname0falsefalsechimerahttp://axschema.org/namePerson/last0falsefalsechimera6730';
if (strpos($testo, 'utente') !== false) {
echo 'utente';
}