php - 使用 jQuery 或 PHP 进行文本比较

标签 php jquery

我有 2 个字符串作为示例,想要查看这两个字符串的文本是否精确。如果字符串不匹配,则应显示哪个是字符串或原始字符串中缺少的句子。

在 jQuery 中可以吗?有代码吗?

我尝试使用很多在线文本比较工具,但没有一个说以下字符串是准确的并且没有区别,需要忽略段落

文字1

In this chapter, you learn some real time-savers. If you are tired of defining
the same layers, along with units, grid, snap, and ltscale, for each new
drawing, read on. You are about to learn how to create your own template
drawings. With templates, you can begin each new drawing with setups
you have defined and saved in previous MEMA sessions, or with a
variety of predefined setups included in the software.
In addition, you learn to reshape the grid using the LIMITS command
and to copy, move, and array objects on the screen so that you
do not have to draw the same thing twice. We begin with the LIMITS
command, because we want to change the limits as part of defining
your first template.

文本2

In this chapter, you learn some real time-savers. If you are tired of defining the same layers, along with units, grid, snap, and ltscale, for each new drawing, read on. You are about to learn how to create your own template drawings. With templates, you can begin each new drawing with setups you have defined and saved in previous MEMA sessions, or with a variety of predefined setups included in the software.
In addition, you learn to reshape the grid using the LIMITS command and to copy, move, and array objects on the screen so that you do not have to draw the same thing twice. We begin with the LIMITS command, because we want to change the limits as part of defining your first template.** 

最佳答案

您正在寻找“Diff”实现,这并非完全微不足道。 PHP 和 JavaScript 都可以实现。

查看这些问题:

要查找更多内容:

关于php - 使用 jQuery 或 PHP 进行文本比较,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8503546/

相关文章:

php - 如何在从 jquery 中选择一个选择选项时从数据库中获取数据

jquery - 使用Jquery悬停播放音频

php - 我可以使用 CI 进行多次事务更新,如果更新失败则将其全部回滚吗?

javascript - 从字符串中获取数字(十进制数字)

php - 从 PHP 函数中的 foreach 检索多个值(不固定数量的值)

php - 存储站点全局变量

javascript - 检查是否在 jQuery 中设置了最大宽度?

javascript - Jquery中使用的Blob是什么

php - 密码保护链接列表*和*密码保护文件访问

php - Shopify - Liquid - {% if form.posted_successfully? %} 不适用于注册客户模块