-3

=~它的有线问题,但我想知道和之间有什么区别==

在“字符串”之后我试图找到。

if($ua =~ "friendly-scanner") {
  drop()
}

VS

if($ua == "friendly-scanner") {
  drop()
}
4

1 回答 1

1
=~ - Does a regular expression matching
== - Compares two for equality

例如:

if($ua =~ "^friendly") is "$ua begins with friendly"
if($ua == "friendly") is "$ua exact match with friendly"
于 2014-12-17T17:40:35.680 回答