| highlight_phrase() | ใช้แทรก tag html ลงไปในคำที่กำหนด |
|---|
function:highlight_phrase ( text, phrase, open_tag, close_tag )
return type:string
content:ใช้แทรก tag html ลงไปในคำที่กำหนด
example:$text = "I love you."; echo highlight_phrase ( $text, "love", "<span style='color:red;'>", "</span>" );
comment:ตัวแปร text คือ ข้อความที่มีคำที่ต้องการให้ถูกแทรก tag html ตัวแปร phrase คือ ข้อความที่ต้องการให้ถูกแทรก tag html ตัวแปร open_tag คือ tag เปิดที่จะแทรก ตัวแปร close_tag คือ tag ปิดที่จะแทรก