มี PHP function ไหนที่ตัด Code html ออกจาก ไฟล์ใหมครับ
ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา มี PHP function ไหนที่ตัด Code html ออกจาก ไฟล์ใหมครับ
มี PHP function ไหนที่ตัด Code html ออกจาก ไฟล์ใหมครับ
มี PHP function ไหนที่ตัด Code html ออกจาก ไฟล์ใหมครับ
เช่น <html><header>test<br></header>
จะเอาแค่ test<br>

คำแนะนำ และการใช้งาน
สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก
- ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
ความคิดเห็นที่
1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | <?php function getonlytext( $text ) { $text = preg_replace( array ( // Remove invisible content '@<head[^>]*?>.*?</head>@siu' , '@<style[^>]*?>.*?</style>@siu' , '@<script[^>]*?.*?</script>@siu' , '@<object[^>]*?.*?</object>@siu' , '@<embed[^>]*?.*?</embed>@siu' , '@<applet[^>]*?.*?</applet>@siu' , '@<noframes[^>]*?.*?</noframes>@siu' , '@<noscript[^>]*?.*?</noscript>@siu' , '@<noembed[^>]*?.*?</noembed>@siu' , // Add line breaks before and after blocks '@</?((address)|(blockquote)|(center)|(del))@iu' , '@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu' , '@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu' , '@</?((table)|(th)|(td)|(caption))@iu' , '@</?((form)|(button)|(fieldset)|(legend)|(input))@iu' , '@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu' , '@</?((frameset)|(frame)|(iframe))@iu' , ), array ( ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , ' ' , "n$0" , "n$0" , "n$0" , "n$0" , "n$0" , "n$0" , "n$0" , "n$0" , ), $text ); return strip_tags ( $text ); } ?> |
เคยใช้ตัวนี้ อยู่ เอาไปลองดู

ความคิดเห็นที่
2
ขอบคุงครับ

ขอบคุณทุกการสนับสนุน
![]()