= Stripslashes=

This is a string modifier to remove slashes (for escaped strings)

Nathan Grebowiec

(suggestions, bug reports, etc can be directed to njgreb at gmail dot com)

Usage

Sample Code

<?php
$smarty->assign("somestring","fruit\\'s");
?>

Sample Template

{$somestring}<br />
{$somestring|stripslashes}

Output

fruit\'s
fruit's

Plugin Code

Copy the following code to modifier.stripslashes.php and put it in your smarty plugins directory.

(last updated 2009-04-09)

-----------------------------------------------------------------------------------
<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty slash stripping plugin
 *
 * Type:     modifier<br>
 * Name:     stripslashes<br>
 * Purpose:  remove slashes froma string
 * @author   Nathan Grebowiec <njgrebo at gmail dot com>
 * @param string
 * @return string
 */
function smarty_modifier_stripslashes($string)
{
    return stripslashes($string);
}

?>
-----------------------------------------------------------------------------------