strip-tags

    0熱度

    1回答

    我正在使用strip_tags從xml文件中剝離標籤,並且在數組大小很小時工作得很好,但如果頁面很大,它總是崩潰。這裏是我的腳本,可用於最多100個值但崩潰的更大的價值 preg_match_all("/<image:caption>.*?<\/image:caption>|<image:loc>.*?<\/image:loc>|<loc>.*?<\/loc>/", $str, $results

    1熱度

    1回答

    我試圖從評論框表單顯示評論在我的網站上。我最初使用的是: <?php while($comment_text = mysqli_fetch_assoc($display_comments)) { ?> <div class="comment" style="margin-bottom: 2em;"> <div class="author"> <b><?php echo ht

    0熱度

    3回答

    我在數據庫description中有一個字段,系統將在其中保存HTML代碼。 ,我有一個搜索系統,帶Q的工作原理: Post.objects.filter(Q(name__icontains=keyword) | Q(description__icontain=keyword)) 它工作正常,但問題是指它時,例如'<strong>'或'strong'用戶searchs它會返回在他們'<stro

    0熱度

    1回答

    我有一個textarea,我的用戶需要被允許發佈鏈接,郵件和圖像。 function autolink($message) { $text = " " . $message; $text = preg_replace("#([\n ])([a-z]+?)://([a-z0-9\-\.,\?!%\*_\#:;~\\&[email protected]\/=\+]+)#i", "

    0熱度

    1回答

    我正在尋找從網頁過濾輸入html文本並過濾它保留文本格式和剝離的最佳方法讓我們說標籤和其他危險標籤,並仍然阻止mysql注入。 例如: INPUT <p>I'm new here and i dont know much about php programming</p> <a href='maliciousWebsite.com'>Click here!</a> 'MYSQL INSTRUC

    0熱度

    1回答

    如何在php中顯示xml內容後刪除html標籤?我也試過strip_tags,但不工作,以消除html標籤? PHP代碼在PHP頁面 <div style="width:50%" align="center"> <?php echo strip_tags($a) ?></div> ** aboutus.xml文件** <?xml version="1.0" encoding="UTF-8"?>

    0熱度

    1回答

    我使用WordPress的項目PHP的strip_tag功能,它只是確定,當鏈接包含兩個下劃線 除了(例如:http://www.youtube.com/watch?v=CS7e1__lyn4)進來當鏈路時,它將返回空。有沒有辦法告訴strip_tag忽略兩個下劃線?

    3熱度

    2回答

    是否可以通過strip_tags去除鏈接到圖像上的標籤? 比如我想 <a href=""><img src="" /></a> 是 <img src="" /> 我需要保持形象,並刪除所有標籤一個是他們身邊。除了使用Simple HTML Dom我希望有這樣做

    0熱度

    1回答

    必須有一種更有效的方式來編寫此代碼(如下)有人可以提供一個解決方案,以更有效的方式顯示多個Ifs嗎? if ( isset($_POST["submit"]) || isset($_POST["submit_x"]) ) { // strip_tags removes tags and then we compare to the original contents

    0熱度

    1回答

    無論何時我輸入數據庫,我都使用strip_tags函數,並且每當輸出信息時我使用htmlspecialchars。這就是說,如果我引入數據庫是這樣的: Hello, Mr. John. "Come on.." 輸出是: Hello, Mr. John. \"Come on..\" 我怎樣才能避免這種情況?