I have this string: $entitlemnet = '43857403,erot,43857403,erot,rejh'
I want to remove all the duplicate values from this string. How can i do that?
See code below.
$roql_Ent_result = RNCPHP\ROQL::query($EntQuery)->next();
while ($Ent_result = $roql_Ent_result->next())
{
$Entitlement = $Ent_result['Entitlement'];
$findme = $Entitlement.",";
$pos = stripos($EntitlementString, $findme);
if ($pos === false)
{
$EntitlementString = $EntitlementString.$Entitlement.", ";
}
}
if ($EntitlementString != "")
{
$EntitlementString = substr($EntitlementString,0,(strlen($EntitlementString)-2)).";";
}
43857403,erot,43857403,erot,rejhwill result to43857403,erot,rejh?