我在preg_match和str_replace之后使用get_file_content时遇到问题。
当我从基地阅读时,文字看起来像:
Some text with shortcodes: [formularz {"agree":"1,1,1","option":"firstname,lastname,phone,email,company","leadfrom":"Allegro"}] [formularz {"agree":"0,1,0","option":"firstname,lastname,phone","leadfrom":"Allegro"}]
然后我查看我的常规' []':
preg_match_all('/\[formularz (.*)\]/',$campaign['content'],$matches);
然后我替换了一些字符和单词:
echo str_replace($matches[0],str_replace([':','","','"','{','}'],['=','&','','file_get_contents("http:// mydomain.com/form.php?id_added_to_lead='.$id_added_to_lead.'&','")'],$matches[1]),str_replace(array("\r\n", "\r", "\n"), "
",stripslashes($campaign['content']))) ;
最后我有:
Some text with shortcodes: file_get_contents("http:// mydomain.com/form.php?id_added_to_lead=100&agree=1,1,1&option=firstname,lastname,phone,email,company&leadfrom=Allegro") file_get_contents("http:// mydomain.com/form.php?id_added_to_lead=100&agree=0,1,0&option=firstname,lastname,phone&leadfrom=Allegro")
如果我想在内容中执行file_get_content,我该怎么办?