2
這是我的代碼。替換preg_replace_callback的preg_replace給我一個警告
private function _checkMatch($modFilePath, $checkFilePath) {
$modFilePath = str_replace('\\', '/', $modFilePath);
$checkFilePath = str_replace('\\', '/', $checkFilePath);
$modFilePath = preg_replace('/([^*]+)/e', 'preg_quote("$1", "~")', $modFilePath);
$modFilePath = str_replace('*', '[^/]*', $modFilePath);
$return = (bool) preg_match('~^' . $modFilePath . '$~', $checkFilePath);
return $return;
}
我將preg_replace改爲preg_replace_callback,但它給了我下面的錯誤。
Warning: preg_replace_callback(): Requires argument 2, 'preg_quote("$1", "~")', to be a valid callback
我目前使用Opencart的版本1.x.x
任何一個可以幫助我嗎?
三江源這麼多! –