I am filling in for a backend developer and building out a referral program. I have a $user->street_address
and a $referrer->street_address
. I am trying to check if these two match or are similar to avoid users referring themself. I come from a javascript background ... is regex the best way to handle this?
Asked
Active
Viewed 101 times
0

burtonLowel
- 734
- 7
- 17
-
1"Match" is pretty easy, just `$user->street_address == $referrer->street_address`. "Similar" is a giant can of worms; depending on what `street_address` contains, case sensitivity, spaces, etc. – Tim Lewis Dec 02 '19 at 18:25
-
duplicate https://stackoverflow.com/questions/16520646/how-to-check-a-partial-similarity-of-two-strings-in-php – alexloehr Dec 02 '19 at 18:26