当前位置: 首页>>代码示例>>PHP>>正文


PHP stripSlashes函数代码示例

本文整理汇总了PHP中stripSlashes函数的典型用法代码示例。如果您正苦于以下问题:PHP stripSlashes函数的具体用法?PHP stripSlashes怎么用?PHP stripSlashes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了stripSlashes函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: RepSpeRssStr

function RepSpeRssStr($str)
{
    $str = stripSlashes($str);
    $str = ehtmlspecialchars($str, ENT_QUOTES);
    $str = str_replace(array('[!--empirenews.page--]', '[/!--empirenews.page--]', '[', ']'), array('', '', '', ''), $str);
    return $str;
}
开发者ID:novnan,项目名称:meiju,代码行数:7,代码来源:index.php

示例2: RepPostVar

function RepPostVar($val)
{
    $val = str_replace(" ", "", $val);
    $val = str_replace("'", "", $val);
    $val = str_replace("\"", "", $val);
    $val = addslashes(stripSlashes($val));
    return $val;
}
开发者ID:laiello,项目名称:netos-cms,代码行数:8,代码来源:connect.php

示例3: unserializeData

 protected function unserializeData()
 {
     $data = $this->getData();
     $result = null;
     $dataType = gettype($data);
     switch ($dataType) {
         case 'object':
             $dataType = get_class($data);
         case 'TSimpleHttpResponse':
             $format = $this->getServiceProtocol();
             if ($data->isHeader('X-MCP-API-ResonseServiceProtocol')) {
                 $format = $data->getHeader('X-MCP-API-ResonseServiceProtocol');
             }
             if (!in_array($format, array($this->getServiceProtocol(), TServiceProtocol::NONE, TServiceProtocol::UNKNOWN))) {
                 throw new TDispatchAdapterException('adapter_protocol_not_supported', __CLASS__, $format);
             }
             $result = TNvpSerializer::unserialize($data->getBody());
             break;
         case 'boolean':
         case 'integer':
         case 'boolean':
         case 'array':
         case 'null':
         case 'NULL':
             $result = TNvpSerializer::unserialize(TNvpSerializer::serialize($data));
             break;
         case 'string':
             $result = TNvpSerializer::unserialize($data);
             break;
         case 'resource':
         case 'unknown type':
         default:
             throw new TDispatchAdapterException('adapter_datatype_not_supported', $dataType);
             break;
     }
     do {
         if (!isset($result['error'])) {
             break;
         }
         if ($result['error'] == 0) {
             break;
         }
         $code = $result['error'];
         $msg = isset($result['errorMessage']) ? stripSlashes($result['errorMessage']) : '';
         throw new Exception($msg, $code);
     } while (0);
     do {
         if (!isset($result['result'])) {
             break;
         }
         if (count($result) > 2) {
             break;
         }
         $result = $result['result'];
     } while (0);
     return $result;
 }
开发者ID:grlf,项目名称:eyedock,代码行数:57,代码来源:TNvpDispatchResponseAdapter.php

示例4: stripslashes

 /**
  * @ stripslashes()
  * @param data $data
  * @return string $data
  * addSlashes adverse function
  * */
 public static function stripslashes($data)
 {
     if (is_array($data)) {
         foreach ($data as $key => $value) {
             $data[$key] = self::stripSlashes($value);
         }
     } else {
         $data = stripSlashes(trim($data));
     }
     return $data;
 }
开发者ID:uwitec,项目名称:mgoa,代码行数:17,代码来源:request.php

示例5: serialize_array

 public function serialize_array($name, $arr)
 {
     $tmp = json_encode($arr);
     $tmp = str_replace(":{", " => [", $tmp);
     $tmp = str_replace("{", "[", $tmp);
     $tmp = str_replace("},", "],\n\t", $tmp);
     $tmp = str_replace("}", "]", $tmp);
     $tmp = str_replace(":", " => ", $tmp);
     $tmp = str_replace('"', "'", $tmp);
     $tmp = "\$" . $name . " = " . stripSlashes($tmp) . ";";
     return $tmp;
 }
开发者ID:orchid,项目名称:orchid,代码行数:12,代码来源:Tools.php

示例6: ShowBuyproduct

function ShowBuyproduct($buycar, $payby)
{
    global $empire, $dbtbpre;
    $record = "!";
    $field = "|";
    $r = explode($record, $buycar);
    $alltotal = 0;
    $alltotalfen = 0;
    echo "<table width='100%' border=0 align=center cellpadding=3 cellspacing=1>\r\n          <tr class='header'> \r\n            <td width='9%' height=23> <div align=center>序号</div></td>\r\n            <td width='43%'> <div align=center>商品名称</div></td>\r\n            <td width='19%'> <div align=center>单价</div></td>\r\n            <td width='10%'> <div align=center>数量</div></td>\r\n            <td width='19%'> <div align=center>小计</div></td>\r\n          </tr>";
    $j = 0;
    for ($i = 0; $i < count($r) - 1; $i++) {
        $j++;
        $pr = explode($field, $r[$i]);
        $productid = $pr[1];
        $fr = explode(",", $pr[1]);
        //ID
        $classid = (int) $fr[0];
        $id = (int) $fr[1];
        //数量
        $num = (int) $pr[2];
        if (empty($num)) {
            $num = 1;
        }
        //单价
        $price = $pr[3];
        $thistotal = $price * $num;
        $buyfen = $pr[4];
        $thistotalfen = $buyfen * $num;
        if ($payby == 1) {
            $showprice = $buyfen . " 点";
            $showthistotal = $thistotalfen . " 点";
        } else {
            $showprice = $price . " 元";
            $showthistotal = $thistotal . " 元";
        }
        //产品名称
        $title = stripSlashes($pr[5]);
        //返回链接
        $titleurl = "../../public/InfoUrl/?classid={$classid}&id={$id}";
        $alltotal += $thistotal;
        $alltotalfen += $thistotalfen;
        echo "<tr>\r\n\t<td align=center>" . $j . "</td>\r\n\t<td align=center><a href='" . $titleurl . "' target=_blank>" . $title . "</a></td>\r\n\t<td align=right><b>¥" . $showprice . "</b></td>\r\n\t<td align=right>" . $num . "</td>\r\n\t<td align=right>" . $showthistotal . "</td>\r\n\t</tr>";
    }
    //支付点数付费
    if ($payby == 1) {
        $a = "<tr> \r\n      <td colspan=5><div align=right>合计点数:<strong>" . $alltotalfen . "</strong></div></td>\r\n      <td>&nbsp;</td>\r\n    </tr>\r\n\t</table>";
    } else {
        echo "<tr> \r\n      <td colspan=5><div align=right>合计:<strong>¥" . $alltotal . "</strong></div></td>\r\n      <td>&nbsp;</td>\r\n    </tr>\r\n  </table>";
    }
}
开发者ID:BGCX261,项目名称:zjh-dev-svn-to-git,代码行数:50,代码来源:ShowDd.php

示例7: _stripSlashes

 /**
  * enleve tout les slashes d'une chaine ou d'un tableau de chaine
  * @param string/array	$string
  * @return string/array	l'objet transformé
  */
 function _stripSlashes($string)
 {
     if ($this->magic_quotes) {
         if (is_array($string)) {
             $toReturn = array();
             // c'est un tableau, on traite un à un tout les elements du tableau
             foreach ($string as $key => $elem) {
                 $toReturn[$key] = $this->_stripSlashes($elem);
             }
             return $toReturn;
         } else {
             return stripSlashes($string);
         }
     } else {
         return $string;
     }
 }
开发者ID:BackupTheBerlios,项目名称:phpaie,代码行数:22,代码来源:magicquotes.plugin.php

示例8: encode

function encode($string)
{
    $string = trim($string);
    $string = stripSlashes("{$string}");
    $string = str_replace("&", "&amp;", $string);
    $string = str_replace("'", "&#39;", $string);
    $string = str_replace("&amp;amp;", "&amp;", $string);
    $string = str_replace("&amp;quot;", "&quot;", $string);
    $string = str_replace("\"", "&quot;", $string);
    $string = str_replace("&amp;lt;", "&lt;", $string);
    $string = str_replace("<", "&lt;", $string);
    $string = str_replace("&amp;gt;", "&gt;", $string);
    $string = str_replace(">", "&gt;", $string);
    $string = str_replace("&amp;nbsp;", "&nbsp;", $string);
    $string = nl2br($string);
    return $string;
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:17,代码来源:tttof2blog.php

示例9: normalizeArray

 private function normalizeArray(&$arr)
 {
     // The following function strips slashes from
     // an HTTP input. Note: parameter is passed by reference
     // Scan the array
     foreach ($arr as $key => $value) {
         if (!is_array($value)) {
             // Let's go
             $arr[$key] = stripSlashes($value);
         } else {
             // Recursive call.
             $this->normalizeArray($arr[$key]);
         }
     }
     reset($arr);
     return $arr;
 }
开发者ID:camilorivera,项目名称:INNOVARE,代码行数:17,代码来源:Front.php

示例10: API_Login

function API_Login($user, $pass)
{
    global $Block, $setting, $onlineip, $_COOKIE, $_SERVER;
    $pwd = md5($pass);
    $user = Conn()->record("members", "uid,username,password,safecv", "username='{$user}' and password='{$pwd}'");
    if (!$user) {
        return false;
    }
    $winduid = $user[0]['uid'];
    $windpwd = md5($_SERVER['HTTP_USER_AGENT'] . $pwd . $GLOBALS['db_hash']);
    $safecv = $user[0]['safecv'];
    $username = $user[0]['username'];
    $winduser = StrCode(stripSlashes("{$winduid}\t{$windpwd}\t{$safecv}"), "ENCODE");
    $GLOBALS['cookiepre'] = substr(md5($GLOBALS['db_sitehash']), 0, 5) . '_';
    osetcookie('winduser', $winduser, 31536000);
    osetcookie('ck_info', $GLOBALS['db_ckpath'] . "\t" . $GLOBALS['db_ckdomain'], 31536000);
    osetcookie('lastvisit', '', 0);
    $GLOBALS['cookiepre'] = 'onez_';
    osetcookie('userid', $winduid, 31536000);
    osetcookie('username', $username, 31536000);
    return 'Y';
}
开发者ID:shenhua4286,项目名称:gxw,代码行数:22,代码来源:phpwind.php

示例11: parse_template

 public function parse_template()
 {
     // On passe au tpl de la page les 2 variables nécessaires à son bon fonctionnement
     $args = $this->args;
     $datas = $this->datas;
     // On instancie la table des tags par défaut
     $transformateur = new odTransform();
     // On lit le contenu de module.tpl
     $this->read_module();
     // S'il y a quelque chose dans module.tpl, il ne doit y avoir que des tag omodule
     if (strlen($this->file_content) != 0) {
         // On va chercher le tag omodule
         $module_tag = $transformateur->get_named_tag("omodule");
         // On le transforme par l'instruction d'ajout dans la table des tags de odTransform
         $this->file_content = preg_replace($module_tag[0], html_entity_decode($module_tag[1]), $this->file_content);
         // même chose pour le tag block
         $module_tag = $transformateur->get_named_tag("block");
         $this->file_content = preg_replace($module_tag[0], html_entity_decode($module_tag[1]), $this->file_content);
         // On supprime cette variable pour ne pas la retrouver dans les variables définies
         unset($module_tag);
         // Et on exécute l'instruction d'ajout dans la table des tags
         eval(stripSlashes("?\\>" . utf8_encode($this->file_content)));
     }
     // On lit le template de la page
     $this->read_template();
     // S'il y a quelque chose dans le template
     if (strlen($this->file_content) != 0) {
         // On transforme tous les tags trouvés par leur valeur définie dans la table des tags
         foreach ($transformateur->get_all_tags() as $odtag) {
             $this->file_content = preg_replace($odtag[0], html_entity_decode($odtag[1]), $this->file_content);
         }
         // On supprime les variables que l'on ne doit pas voir
         unset($odtag);
         unset($transformateur);
         file_put_contents("logs/output.php", $this->file_content);
         // On évalue le code obtenu de la page
         eval(stripSlashes("?\\>" . utf8_encode($this->file_content)));
     }
 }
开发者ID:orchid,项目名称:orchid,代码行数:39,代码来源:odTemplate.class.php

示例12: ecmsShowInfoTop

function ecmsShowInfoTop($query, $where, $field, $topnum, $day)
{
    global $empire, $dbtbpre, $class_r;
    if ($day) {
        $and = $where ? ' and ' : ' where ';
        $query .= $and . "newstime>=" . time() . "-" . $day * 24 * 3600;
    }
    if ($field == 'plnum') {
        $word = '评论数';
    } elseif ($field == 'totaldown') {
        $word = '下载数';
    } elseif ($field == 'onclick') {
        $word = '点击数';
    }
    $query .= " order by " . $field . " desc limit " . $topnum;
    echo "<table width='100%' border='0' cellpadding='3' cellspacing='1' class='tableborder'><tr><td width='85%'>标题</td><td width='15%'>{$word}</td></tr>";
    $sql = $empire->query($query);
    while ($r = $empire->fetch($sql)) {
        $classurl = sys_ReturnBqClassname($r, 9);
        $titleurl = sys_ReturnBqTitleLink($r);
        echo "<tr bgcolor='#ffffff' height='23'><td>[<a href='" . $classurl . "' target='_blank'>" . $class_r[$r[classid]][classname] . "</a>] <a href='{$titleurl}' target='_blank' title='发布时间:" . date("Y-m-d H:i:s", $r[newstime]) . "'>" . stripSlashes($r[title]) . "</a></td><td>" . $r[$field] . "</td></tr>";
    }
    echo "</table>";
}
开发者ID:novnan,项目名称:meiju,代码行数:24,代码来源:infotop.php

示例13: intval

$modid = intval(empty($_GET["modid"]) ? @$args["modid"] : $_GET["modid"]);
$catid = intval(empty($_GET["catid"]) ? @$args["catid"] : $_GET["catid"]);
$start = intval(empty($_GET["start"]) ? @$args["start"] : $_GET["start"]);
if (empty($modid) && is_object($GLOBALS["xoopsModule"]) && "tag" != $GLOBALS["xoopsModule"]->getVar("dirname")) {
    $modid = $GLOBALS["xoopsModule"]->getVar("mid");
}
if (empty($tag_id) && empty($tag_term)) {
    redirect_header(XOOPS_URL . "/modules/" . $GLOBALS["xoopsModule"]->getVar("dirname") . "/index.php", 2, TAG_MD_INVALID);
    exit;
}
$tag_handler =& xoops_getmodulehandler("tag", "tag");
if (!empty($tag_id)) {
    $tag_obj =& $tag_handler->get($tag_id);
    $tag_term = $tag_obj->getVar("tag_term", "n");
} else {
    if (!($tags_obj = $tag_handler->getObjects(new Criteria("tag_term", addSlashes(stripSlashes($tag_term)))))) {
        redirect_header(XOOPS_URL . "/modules/" . $GLOBALS["xoopsModule"]->getVar("dirname") . "/index.php", 2, TAG_MD_INVALID);
        exit;
    }
    $tag_obj =& $tags_obj[0];
    $tag_id = $tag_obj->getVar("tag_id");
}
if (!empty($tag_desc)) {
    $page_title = $tag_desc;
} else {
    $module_name = "tag" == $xoopsModule->getVar("dirname") ? $xoopsConfig["sitename"] : $xoopsModule->getVar("name");
    $page_title = sprintf(TAG_MD_TAGVIEW, htmlspecialchars($tag_term), $module_name);
}
$xoopsOption["template_main"] = "tag_view.html";
$xoopsOption["xoops_pagetitle"] = strip_tags($page_title);
include XOOPS_ROOT_PATH . "/header.php";
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:view.tag.php

示例14: isset

     $panels[$i - 1]->pict = isset($_GET['panel' . $i . 'pict']) ? stripSlashes($_GET['panel' . $i . 'pict']) : "cfco2014.jpg";
     $panels[$i - 1]->slides = isset($_GET['panel' . $i . 'slides']) ? stripSlashes($_GET['panel' . $i . 'slides']) : "";
     $panels[$i - 1]->txt = isset($_GET['panel' . $i . 'txt']) ? stripSlashes($_GET['panel' . $i . 'txt']) : "Welcome";
     $panels[$i - 1]->txtsize = isset($_GET['panel' . $i . 'txtsize']) ? intval($_GET['panel' . $i . 'txtsize']) : 16;
     $panels[$i - 1]->txtcolor = isset($_GET['panel' . $i . 'txtcolor']) ? stripSlashes($_GET['panel' . $i . 'txtcolor']) : "000000";
     $panels[$i - 1]->html = isset($_GET['panel' . $i . 'html']) ? stripSlashes($_GET['panel' . $i . 'html']) : "exemple.html";
     $panels[$i - 1]->firstline = isset($_GET['panel' . $i . 'firstline']) ? intval($_GET['panel' . $i . 'firstline']) : 1;
     $panels[$i - 1]->fixedlines = isset($_GET['panel' . $i . 'fixedlines']) ? intval($_GET['panel' . $i . 'fixedlines']) : 10;
     $panels[$i - 1]->scrolledlines = isset($_GET['panel' . $i . 'scrolledlines']) ? intval($_GET['panel' . $i . 'scrolledlines']) : 17;
     $panels[$i - 1]->scrolltime = isset($_GET['panel' . $i . 'scrolltime']) ? intval($_GET['panel' . $i . 'scrolltime']) : 10;
     $panels[$i - 1]->scrollbeforetime = isset($_GET['panel' . $i . 'scrollbeforetime']) ? intval($_GET['panel' . $i . 'scrollbeforetime']) : 50;
     $panels[$i - 1]->scrollaftertime = isset($_GET['panel' . $i . 'scrollaftertime']) ? intval($_GET['panel' . $i . 'scrollaftertime']) : 80;
     $panels[$i - 1]->updateduration = isset($_GET['panel' . $i . 'updateduration']) ? intval($_GET['panel' . $i . 'updateduration']) : 3;
     $panels[$i - 1]->radioctrl = isset($_GET['panel' . $i . 'radioctrl']) ? intval($_GET['panel' . $i . 'radioctrl']) : 31;
 }
 $title = isset($_GET['title']) ? stripSlashes($_GET['title']) : "no title";
 $chkall = isset($_GET['chkall']) ? $_GET['chkall'] : null;
 $res = mysql_query("SELECT rcid FROM resultscreen WHERE rcid={$rcid} AND sid={$sid}");
 if (mysql_num_rows($res) > 0) {
     $now = time();
     $str = "cid='" . $cid . "', ";
     $str = $str . "panelscount='" . $panelscount . "', ";
     $str = $str . "style='" . addSlashes($style) . "', ";
     $str = $str . "title='" . addSlashes($title) . "', ";
     $str = $str . "titlesize='" . $titlesize . "', ";
     $str = $str . "titlecolor='" . addSlashes($titlecolor) . "', ";
     $str = $str . "subtitle='" . addSlashes($subtitle) . "', ";
     $str = $str . "subtitlesize='" . $subtitlesize . "', ";
     $str = $str . "subtitlecolor='" . addSlashes($subtitlecolor) . "', ";
     $str = $str . "titleleftpict='" . addSlashes($titleleftpict) . "', ";
     $str = $str . "titlerightpict='" . addSlashes($titlerightpict) . "', ";
开发者ID:jmonclard,项目名称:MopScreens,代码行数:31,代码来源:screen.php

示例15: caGetOption

 /**
  * Get the hierarchy in list form
  * 
  * @param int $pn_id 
  * @param array $pa_options
  *
  *		additionalTableToJoin: name of table to join to hierarchical table (and return fields from); only fields related many-to-one are currently supported
  *		idsOnly = return simple array of primary key values for child records rather than full data array
  *		returnDeleted = return deleted records in list (def. false)
  *		maxLevels = 
  *		dontIncludeRoot = 
  *		includeSelf = 
  * 
  * @return array
  */
 public function &getHierarchyAsList($pn_id = null, $pa_options = null)
 {
     if (!$this->isHierarchical()) {
         return null;
     }
     $pb_ids_only = caGetOption('idsOnly', $pa_options, false);
     $pn_max_levels = caGetOption('maxLevels', $pa_options, null, array('cast' => 'int'));
     $ps_additional_table_to_join = caGetOption('additionalTableToJoin', $pa_options, null);
     $pb_dont_include_root = caGetOption('dontIncludeRoot', $pa_options, false);
     $pb_include_self = caGetOption('includeSelf', $pa_options, false);
     if ($pn_id && $pb_include_self) {
         $pb_dont_include_root = false;
     }
     if ($qr_hier = $this->getHierarchy($pn_id, $pa_options)) {
         if ($pb_ids_only) {
             if (!$pb_include_self || $pb_dont_include_root) {
                 if (($vn_i = array_search($pn_id, $qr_hier)) !== false) {
                     unset($qr_hier[$vn_i]);
                 }
             }
             return $qr_hier;
         }
         $vs_hier_right_fld = $this->getProperty("HIERARCHY_RIGHT_INDEX_FLD");
         $va_indent_stack = array();
         $va_hier = array();
         $vn_cur_level = -1;
         $va_omit_stack = array();
         $vn_root_id = $pn_id;
         while ($qr_hier->nextRow()) {
             $vn_row_id = $qr_hier->get($this->primaryKey());
             if (is_null($vn_root_id)) {
                 $vn_root_id = $vn_row_id;
             }
             if ($pb_dont_include_root && $vn_row_id == $vn_root_id) {
                 continue;
             }
             // skip root if desired
             $vn_r = $qr_hier->get($vs_hier_right_fld);
             $vn_c = sizeof($va_indent_stack);
             if ($vn_c > 0) {
                 while ($vn_c && $va_indent_stack[$vn_c - 1] <= $vn_r) {
                     array_pop($va_indent_stack);
                     $vn_c = sizeof($va_indent_stack);
                 }
             }
             if ($vn_cur_level != sizeof($va_indent_stack)) {
                 if ($vn_cur_level > sizeof($va_indent_stack)) {
                     $va_omit_stack = array();
                 }
                 $vn_cur_level = intval(sizeof($va_indent_stack));
             }
             if (is_null($pn_max_levels) || $vn_cur_level < $pn_max_levels) {
                 $va_field_values = $qr_hier->getRow();
                 foreach ($va_field_values as $vs_key => $vs_val) {
                     $va_field_values[$vs_key] = stripSlashes($vs_val);
                 }
                 if ($pb_ids_only) {
                     $va_hier[] = $vn_row_id;
                 } else {
                     $va_node = array("NODE" => $va_field_values, "LEVEL" => $vn_cur_level);
                     $va_hier[] = $va_node;
                 }
             }
             $va_indent_stack[] = $vn_r;
         }
         return $va_hier;
     } else {
         return null;
     }
 }
开发者ID:samrahman,项目名称:providence,代码行数:85,代码来源:BaseModel.php


注:本文中的stripSlashes函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。