I want to compare two strings (`variable1` and `variable2`) and i want to remove the matching characters from both strings(Only once).

For example: `Variable1 : Apple`, `Variable2 : Ball`

I tried using 

```
array_diff(str_split('ball'), str_split('apple')) 

```

but i got only

> 
> **b** (it removed all matching characters.)
> 
> 
> 

**Expected Output** is 

> 
> * **bl** (letters A,L(only once) removed from the second strings.)
> * **ppe** (letters A,L(only once) removed from the first strings.)
> 
> 
> 

How to remove the characters only once ?