PHP程序里面
//PHP字符替換
function StaticCDN(){
function Rewrite_URI($html){
$pattern ='/https:\/\/(www\.|)baidu\.com\/haha-([^"\']*?)\.(jpg)/i';
$replacement = 'https://360.com/haha-$2.$3';
$html = preg_replace($pattern, $replacement,$html);
return $html;
}
if(!is_admin()){
ob_start("Rewrite_URI");
}
}以上代碼是實現(xiàn)將https://baidu.com/haha/*.jpg 替換為https://360.com/haha/*.jpg
例如:
https://baidu.com/haha/A/1.jpg 替換為 https:/360.com/haha/A/1.jpg
https://baidu.com/haha/B/1.jpg 替換為 https:/360.com/haha/B/1.jpg
https://baidu.com/haha/C/1.jpg 替換為 https:/360.com/haha/C/1.jpg
請問如果如何修改以上代碼實現(xiàn)排除:https://baidu.com/haha/C/這個路徑,不進行替換
是在哪個文件里面寫的,是這么調用這個函數(shù)的
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復@官方研發(fā)技術-小卡 是我自己加的,寫在index.php