Check if strings are x% equal

前端 未结 2 964
时光取名叫无心
时光取名叫无心 2021-01-19 07:25

I want to compare three strings:

\"a text string\" //target string
\"a kind of similar text string\"
\"the cow jumps over the moon\"

And se

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-19 08:00

    In PHP, there is the function similar_text. As for JavaScript, there's the PHP.js project, which re-implements PHP functions in JavaScript. They have an implementation of similar_text you can use.

    The JavaScript implementation doesn't support the percent parameter, it seems.

提交回复
热议问题