Javatpoint Logo
Javatpoint Logo

PHP addcslashes() Function

PHP addcslashes() function is used to add quote string with slashes in a C style. It is case-sensitive

Syntax:

Parameter Description Required/Optional
String String to be esxaped Required
Character Character or range to be escaped. Required

Example 1

Output:

Your String : Welcome to JavaTpoint
By using 'addcslashes()' method your string: Welcome to Java\Tpoint

Example 2

Output:

Your String : Welcome to JavaTpoint
By using 'addcslashes()' method your string: Welcome to J\av\aTpoint

Example 3

Output:

Welcome to JavaTpoint
\Welcome to \Java\Tpoint

Example 4

Output:

Welcome to JavaTpint
W\e\l\c\o\m\e \t\o J\a\v\aT\p\o\i\n\t<\b\r>

Example 5

Output:

Your string value is: Welcome to JavaTpoint
By using addcslashes() Function your value is : W\e\l\co\m\e to J\av\aTp\oint

Next TopicPHP String




Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA