hom*_*ork 3 php regex preg-match
我不知道这是否足够数据,但我有
preg_match('/ SAMPLETEXT /',$ bcurl,$ cookie1);
我想知道我是否能做到
preg_match($ newfunction,$ bcurl,$ cookie1);
但是当我这样做时,我收到此错误"警告:preg_match()[function.preg-match]:分隔符不能是"字母数字或反斜杠".
我怎样才能检查我的新功能,而不是只检查"SAMPLETEXT".
yst*_*sth 10
尝试preg_match("/$newfunction/", $bcurl, $cookie1);使您提供所需的分隔符(使用不会在$ newfunction中的分隔符).
但请注意文档说"如果你只想检查另一个字符串中是否包含一个字符串,请不要使用preg_match().请使用strpos()或strstr(),因为它们会更快."