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


PHP trimm函数代码示例

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


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

示例1: header

<?php

require_once '../sub/init.php';
require_once wrzc_net . 'sub/conn.php';
if (!ereg("^[0-9]{1,8}\$", $cook_userid) || empty($cook_userid)) {
    header("Location: " . $Global['www_2domain'] . "/login.php");
    exit;
} else {
    $cook_password = trimm($cook_password);
    $rt = $db->query("SELECT id FROM " . __TBL_MAIN__ . " WHERE id='{$cook_userid}' AND password='{$cook_password}' AND flag>0");
    if (!$db->num_rows($rt)) {
        header("Location: " . $Global['www_2domain'] . "/login.php");
        exit;
    }
}
if ($submitok == "addupdate") {
    if ($Temp_diarynum >= 1) {
        callmsg("一天只能发一篇", "-1");
    }
    if (empty($title)) {
        callmsg("标题不能为空", "-1");
    }
    if (empty($content)) {
        callmsg("内容不能为空", "-1");
    }
    if (strlen($title) > 100) {
        callmsg("标题太长,请控制在100个字节以内", "-1");
    }
    if (strlen($content) > 30000 || strlen($content) < 20) {
        callmsg("内容过多或过少,请控制在20~20000字节以内", "-1");
    }
开发者ID:norain2050,项目名称:cmlove,代码行数:31,代码来源:f_diary.php

示例2: trimm

.main .right .C .box .R .tt{width:140px;height:20px;color:#999}
.main .right .C .box .R .tt span{color:#f00}
.main .right .C .box .R .mm{width:140px;height:35px;color:#7e7e7e;line-height:18px}
.main .right .C .box .R .bb{width:140px;height:25px;text-align:center}
</style>
</head>
<body>
<?php 
require_once wrzc_net . 'top.php';
?>
<div class="main">
	<div class="left">
		<?php 
$tempsql = '';
if ($t == 1 && !empty($k)) {
    $k = trimm($k);
    $tmpsort = " ORDER BY zhenghun_jingjia DESC,logintime DESC ";
    $tempsql .= " (username LIKE '%" . $k . "%' OR nickname LIKE '%" . $k . "%') AND ";
    $Tfield = "id,username,nickname,grade,sex,birthday,love,kind,area1,area2,photo_s,video_s,heigh,weigh,house,car,edu,job,pay,ifphoto,ifbirthday,ifedu,iflove,ifpay,zhenghun_jingjia ";
    $tmpsql .= "SELECT {$Tfield} FROM " . __TBL_MAIN__ . " WHERE {$tempsql} flag=1 {$tmpsort} LIMIT 50";
} elseif ($t == 2) {
    $Tfield = "id,username,nickname,grade,sex,birthday,love,kind,area1,area2,photo_s,video_s,heigh,weigh,house,car,edu,job,pay,ifphoto,ifbirthday,ifedu,iflove,ifpay,zhenghun_jingjia ";
    $tmpsql = "SELECT {$Tfield} FROM " . __TBL_MAIN__ . " WHERE flag=1 ORDER BY id DESC LIMIT 500";
} else {
    if ($sex == 1) {
        $tempsql .= " sex=1 AND ";
    }
    if ($sex == 2) {
        $tempsql .= " sex=2 AND ";
    }
    if ($photo == 1) {
开发者ID:norain2050,项目名称:cmlove,代码行数:31,代码来源:searchlist.php

示例3: trimm

}
?>
</b></font></td>
<td width="7%" align="right" valign="bottom"><a href="article<?php 
echo $mainid;
?>
.html"></a></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr></table>
<?php 
if (!empty($keyword)) {
    $tmpkeyword = trimm($keyword);
    $tmpkeyword = " title LIKE '%" . $tmpkeyword . "%'";
} else {
    $tmpkeyword = " 1=1 ";
}
if (!empty($bkid)) {
    $tmpbkid = "bkid='{$bkid}'";
} else {
    $tmpbkid = "1=1";
}
switch ($listtype) {
    case 1:
        $tmplisttype = " AND ifjh=1 ORDER BY iftop DESC,endtime DESC";
        break;
    case 2:
        $tmplisttype = " AND iftop=1 ORDER BY endtime DESC";
开发者ID:norain2050,项目名称:cmlove,代码行数:31,代码来源:article.php

示例4: unset

 }
 if (!$ifnext) {
     unset($_SESSION["supdesverify"]);
     setcookie("cook_userid", "", null, "/", $Global['m_cookdomain']);
     setcookie("cook_username", "", null, "/", $Global['m_cookdomain']);
     setcookie("cook_nickname", "", null, "/", $Global['m_cookdomain']);
     setcookie("cook_password", "", null, "/", $Global['m_cookdomain']);
     setcookie("cook_grade", "", null, "/", $Global['m_cookdomain']);
     setcookie("cook_sex", "", null, "/", $Global['m_cookdomain']);
     setcookie("cook_photo_s", "", null, "/", $Global['m_cookdomain']);
     setcookie("cook_if2", "", null, "/", $Global['m_cookdomain']);
     setcookie("cook_stealth", "", null, "/", $Global['m_cookdomain']);
     callmsg($varmsg, "-1");
 } else {
     $form_username = trim($form_username);
     $password = trimm($form_password1);
     $password = md5($password);
     $regtime = date("Y-m-d H:i:s");
     $regip = getip();
     $db->query("INSERT INTO " . __TBL_MAIN__ . "  (username,nickname,password,loveb,regtime,regip,logintime,loginip,sex,birthday,love,kind,area1,area2,email,yctel) VALUES ('{$form_username}','{$form_username}','{$password}','" . $Global['m_regloveb'] . "','{$regtime}','{$regip}','{$regtime}','{$regip}','{$form_sex}','{$form_birthday}','{$form_love}','{$form_kind}','{$province}','{$city}','{$form_email}','{$yctel}')");
     $tmpid = $db->insert_id();
     if (empty($stealth)) {
         $stealth = 0;
     }
     setcookie("cook_userid", $tmpid, null, "/", $Global['m_cookdomain']);
     setcookie("cook_username", $form_username, null, "/", $Global['m_cookdomain']);
     setcookie("cook_nickname", $form_username, null, "/", $Global['m_cookdomain']);
     setcookie("cook_grade", 1, null, "/", $Global['m_cookdomain']);
     setcookie("cook_password", $password, null, "/", $Global['m_cookdomain']);
     setcookie("cook_sex", $form_sex, null, "/", $Global['m_cookdomain']);
     setcookie("cook_photo_s", "", null, "/", $Global['m_cookdomain']);
开发者ID:JokeLook,项目名称:cmlove,代码行数:31,代码来源:reg.php

示例5: header

     header("Location: detail" . $fid . ".html");
     break;
 default:
     $rt = $db->query("SELECT a.username,a.nickname,a.grade,a.loveb,a.sex,b.userid,b.title,b.content,b.content2,b.xsloveb,b.addtime,b.click,b.hfnum,b.flag,b.ifopen,b.ifjh FROM " . __TBL_MAIN__ . " a," . __TBL_ASK__ . " b WHERE a.id=b.userid  AND a.flag=1 AND b.id=" . $fid);
     if ($db->num_rows($rt)) {
         $row = $db->fetch_array($rt);
         $uid = $row['userid'];
         $username = $row['username'];
         $nickname = badstr($row['nickname']);
         $grade = $row['grade'];
         $loveb = $row['loveb'];
         $sex = $row['sex'];
         $click = $row['click'];
         $title = htmlout(stripslashes($row['title']));
         $content = htmlout(stripslashes($row['content']));
         $content2 = badstr(trimm(stripslashes($row['content2'])));
         $xsloveb = $row['xsloveb'];
         $addtime = $row['addtime'];
         $click = $row['click'];
         $hfnum = $row['hfnum'];
         $flag = $row['flag'];
         $ifopen = $row['ifopen'];
         $ifjh = $row['ifjh'];
         if (empty($content2)) {
             $content2 = '<h1>暂无补充内容</h1>';
         }
         $ifjh = $ifjh == 1 ? ' <img src=images/j.gif title=推荐病历 />' : '';
         switch ($flag) {
             case 1:
                 $flagP = "<img src=images/56.gif>";
                 break;
开发者ID:JokeLook,项目名称:cmlove,代码行数:31,代码来源:detail.php


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