วันอาทิตย์ที่ 11 พฤษภาคม พ.ศ. 2557

20:07
ฟังก์ชัน quotemeta()
เติม backslashes ( \ ) หน้า predefined characters ด้วยฟังก์ชัน quotemeta()


predefined characters คือ
จุด .
backslash \
เครื่องหมายบวก +
เครื่องหมายดาว(asterisk) *
เครื่องหมายคำถาม ?
เครื่องหมายปีกกาสี่เหลี่ยม(brackets) [ ]
เครื่องหมายcaret ^
dollar sign $
เครื่องหมายวงเล็บ ( )

รูปแบบ
quotemeta(string)

string คือ สตริงที่ต้องการใส่ backslash


ตัวอย่าง
<?php

$str = "this is the test string.";
echo quotemeta($str);

?>

ผลลัพธ์
this is the test string\.

0 ความคิดเห็น:

แสดงความคิดเห็น

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.