> Online tutorial : addcslashes() and backcslashes() in php
Showing posts with label addcslashes() and backcslashes() in php. Show all posts
Showing posts with label addcslashes() and backcslashes() in php. Show all posts

passing arguments

Information may be passed to function via the argument list.which is a comma-delimited list of expression
Example

<?php
function my($num)
{
echo "$num";
}
my("india");
?>


Output

addcslashes() and backcslashes() in php

addcslashes() and backcslashes()
The addcslashes() function return a string with backslashes in front of the specified character
Syntax
string addcslashes( string $str,string $charlsit)

Example

<?php
$str="welcome to india";
echo $str;
echo addcslashes($str,'c');
?>


Output:



wel\come to india

backcslashes()
The backcslashes() function removed the character added from addcslashes() function
Syntax:

backcslashes(string)

<?php
echo backcslashes("wel\come to india");
?>
Output
welcome to india