When my ecshop enters the index page, it always reports the following error: Warning: preg_replace_callback (): Requiresargument2, & #39; Array & #39;, tobeavalidcallbackinC: callback source code: $ patternarray (& #39; & #39;, replace the smarty annotation & # ecshopphp source code callback
When my ecshop enters the index page, it always reports the following error: Warning: preg_replace_callback (): Requires argument 2, 'array', to be a valid callback in C: \ AppServ \ www \ ecshop \ shortdes \ cls_template.php on line 1152 cls_template.php source code: $ pattern = array ('/
/', // Replace the smarty comment '/
/', // Replace the html comment without line breaks'/(href = ["| \ ']) \. \. \/(. *?) (["| \ '])/I', // replace the relative link '/((? : Background | src) \ s * = \ s * ["| \ ']) (? : \. \/| \.\.\/)? (Images \/.*? ["| \ '])/Is', // add $ tmp_dir '/((? : Background | background-image): \ s *? Url \()(? : \. \/| \.\.\/)? (Images \/)/is ', // add $ tmp_dir'/([\ '| "]) \ before images. \. \ // is ', // .. all paths starting with/are corrected as null); $ replace = array ('\ 1', '',' \ 1 \ 2 \ 3', '\ 1 '. $ tmp_dir. '\ 2',' \ 1 '. $ tmp_dir. '\ 2',' \ 1'); // return preg_replace ($ pattern, $ replace, $ source); return preg_replace_callback ($ pattern, $ replace, $ source );