I have two strings:
$stringA = "1,2,3,4";
$stringB = "1,2,4,5";
I want to pick out the values from $stringB
that are not in $stringA
.
How can I do that?
I have two strings:
$stringA = "1,2,3,4";
$stringB = "1,2,4,5";
I want to pick out the values from $stringB
that are not in $stringA
.
How can I do that?
explode() both arrays and use array_diff() to compute differential array.
http://pear.php.net/package/Text_Diff/
That should help you out ...
A combination of explode and array_diff should get you there.
array_diff(explode(',', $stringB), explode(',', $stringA));