0
나는 XML 파일을 처리하지있어 때로는 "iframe을"내가 나갈 필요가 및 "스크립트" 태그, 심지어 'XML- 전에이있다 parse-it 'PHP 스트립 iframe을 스크립트 태그 (더를 htmlentities())
나는 정규 표현식을 시도하고 있지만 잘못 알고있다! :(
테스트 문자열 :
$teststring = 'p><iframe src="http://www.facebook.com/plugins/like.php?href=abcdef&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=dark&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowtransparency="true"></iframe></p>';
//todo clean this up// found this function on net. //more legacy stufff
$Rules = array(
'@<script[^>]*?>.*?</script>@si', // Strip out javascript
'@&(cent|#162);@i', // Cent
'@&(pound|#163);@i', // Pound
'@&(copy|#169);@i', // Copyright
'@&(reg|#174);@i', // Registered
'@&#(d+);@e', // Evaluate as php
---> PROBLEM--> '@<iframe [^<]<.*?<\/iframe>@i',
);
$Replace = array(
'',
chr(162),
chr(163),
chr(169),
chr(174),
'chr()',
'',
);
//expecting <p></p>
$data = preg_replace($Rules, $Replace, $teststring);
echo $data;
멋진 :) 감사하십시오! – user914584
최고급 .... 당신은 화격자입니다. :) –
고맙습니다 .... :) @lake –