PHP ADDCSLASHES,chr php,addslashes in php example,remove substring from string php,addcslashes in php, PHP ADDCSLASHES, Shopinson, Shopinson

MEANING OF PHP ADDCSLASHES

PHP ADDCSLASHES Quotes string with slashes in a C style

PHP ADDCSLASHES,chr php,addslashes in php example,remove substring from string php,addcslashes in php, PHP ADDCSLASHES, Shopinson, Shopinson
MEANING OF PHP ADDCSLASHES

FULL MEANING OF PHP ADDCSLASHES

Php addcslashes() function as the name implies stands for Add C-style Slashes

PHP ADDCSLASHES stands for Add C-style Slashes.

USAGE OF PHP ADDCSLASHES

PHP ADDCSLASHES returns the escaped string

SYNTAX OF PHP ADDCSLASHES

addcslashes ( $string, $charlist )

TECHNICAL FEATURES OF PHP ADDCSLASHES

Supported in (PHP 4, PHP 5, PHP 7)

DESCRIPTION OF PHP ADDCSLASHES

PHP ADDCSLASHES function returns a string that have backslashes before characters which are listed in charlist parameter.

PARAMETERS / PROPERTIES OF PHP ADDCSLASHES

$string The string to be escaped.
$charlist A list of characters to be escaped.

EXAMPLE(S) OF PHP ADDCSLASHES #1

<?php
echo addcslashes('Shopinson', 'A..z');
?>

The example will output “\S\h\o\p\i\n\s\o\n

EXAMPLE(S) OF PHP ADDCSLASHES #2

<?php
echo addcslashes('Hello Mr. Shopinson', 's')."<br>"; //Output "Hello Mr. Shopin\son"
echo addcslashes('Hello Mr. Shopinson', 'o')."<br>"; //Output  "Hell\o Mr. Sh\opins\on"
echo addcslashes('Hello Mr. Shopinson', 'M')."<br>";//Output "Hello \Mr. Shopinson"
?>

This example outputs the result below

Hello Mr. Shopin\son
 Hell\o Mr. Sh\opins\on
 Hello \Mr. Shopinson

EXAMPLE(S) OF PHP ADDCSLASHES #3

<?php
echo addcslashes("shopinson['.'].com", 'z..A');
?> 

The example outputs “\s\h\o\p\i\n\s\o\n\['.'\].\c\o\m

0 Comments

Leave a reply

Your email address will not be published. Required fields are marked *

*

shopinson-logo-32

©2020 Shopinson: complete guide to programming language

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account