Reputation: 1254
I need to create a function that will return true or false based on comparison results.
I have two strings:
$one = 'sample product - White - Large'; // White is separate key, and large is separate too
$two = 'White Large';
Do you know any quick way for doing that task? Exploding two strings might not be safe as some strings instead of White will have: Blue - Black - Large. So I'm looking for existence of Blue - Black.
Another example of my data is:
$one = 'sample product - White - Blue - Large'; // White - Blue is separate key, Large is separate too.
If someone have any ideas on how to do it, I would really appreciate it.
Thanks, eloleon
Upvotes: 3
Views: 2800
Reputation: 42885
I'd go for a strategy like that:
Upvotes: 7