ฟังก์ชัน addcslashes สามารถใช้ได้ ไวยากรณ์ของฟังก์ชัน:
string addcslashes ( string $str, string $charlist )
ฟังก์ชันนี้คืนสตริงพร้อม backslash ปรากฏหน้าตัวอักษร ตัวอย่างด้านล่าง:
ตัวอย่าง
<?php echo addcslashes('sample[ ]', 'A..z'); ?>ผลลัพธ์
จะได้ผลลัพธ์ดังนี้:
\s\a\m\p\l\e\[ \]