Login +

Documentation

SLS_String::addSlashes

Since SillySmart 1.0

Description

Add escape character before quotes or double quotes
static string addSlashes ( string $element, [ string $type ] );

Parameters

  • string $element
    the element to escape
  • string $type
    QUOTES ' or DOUBLE_QUOTES "

Return

string $string
the string quoted

Exemples

  •  var_dump(SLS_String::addSlashes("sls is goin' to rules","QUOTES"));
     // will produce : "sls is goin\' to rules"
  •  var_dump(SLS_String::addSlashes('sls is goin to " rules',"DOUBLE_QUOTES"));
     // will produce : "sls is goin' to \" rules"

Comments

No comment on this function, be the first !

Add your comment

You must login/register to post a reply.