MEANING OF PHP ADDSLASHES

PHP ADDSLASHES Quotes string with slashes

FULL MEANING OF PHP ADDSLASHES

Php addslashes() function as the name implies stands for Add Slashes

PHP ADDSLASHES stands for Add Slashes.

USAGE OF PHP ADDSLASHES

PHP ADDSLASHES returns the escaped string

SYNTAX OF PHP ADDSLASHES

addslashes ( $string )

PHP ADDSLASHES TECHNICAL FEATURES

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

DESCRIPTION OF PHP ADDSLASHES

PHP ADDSLASHES Returns a string that has backslashes added before characters that are needed to be escaped. These characters may be one the below listed:

  • single quote (')
  • double quote (")
  • backslash (\)
  • NUL (the NUL byte)

PARAMETERS / PROPERTIES OF PHP ADDSLASHES

$string The string to be escaped.

EXAMPLE(S) OF PHP ADDSLASHES

<?php
echo addslashes("Shopinson's Blog")."<br>"; 
echo addslashes("It's me Godwin")."<br>"; 
echo addslashes("the God's Grace is sufficient");
?>

This example outputs result below
Shopinson\'s Blog
It\'s me Godwin
the God\'s Grace is sufficient

LEAVE A REPLY

Please enter your comment!
Please enter your name here