我可以使用phpQuery找到完全匹配吗?(Can I find exact match using phpQuery?)

您所在的位置:网站首页 学c语言有什么实际用途 我可以使用phpQuery找到完全匹配吗?(Can I find exact match using phpQuery?)

我可以使用phpQuery找到完全匹配吗?(Can I find exact match using phpQuery?)

2023-03-26 14:18| 来源: 网络整理| 查看: 265

我用phpQuery制作了一个脚本。 该脚本找到包含某个字符串的td:

$match = $dom->find('td:contains("'.$clubname.'")');

直到现在它还运作良好。 因为一个俱乐部名称是奥地利卢斯特瑙,第二个俱乐部是Lustenau。 它将选择两个俱乐部,但它只应选择Lustenau(第二个结果),所以我需要找到一个包含完全匹配的td。

我知道phpQuery正在使用jQuery选择器,但不是全部。 有没有办法使用phpQuery找到完全匹配?

I made a script using phpQuery. The script finds td's that contain a certain string:

$match = $dom->find('td:contains("'.$clubname.'")');

It worked good until now. Because one clubname is for example Austria Lustenau and the second club is Lustenau. It will select both clubs, but it only should select Lustenau (the second result), so I need to find a td containing an exact match.

I know that phpQuery are using jQuery selectors, but not all. Is there a way to find an exact match using phpQuery?



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3