23 篇
建站知识总结与分享
搜索“substr”
不用新变量直接交换现有两个变量的值
web 0 0
1983 0 2019-04-01 PHP
<?php $a = 1; $b = 2; // 方法一 list($a, $b) = array($b, $a); ?> <?php $a = 1; $b = 2; //方法二 $a = $a . $b; // $a为12 $b = substr($a, 0, (strlen($a)-strlen($b))); // ...
PHP获取文件后缀名
web 0 0
2018 0 2018-11-01 PHP
1.$file = 'x.y.z.png'; echo substr(strrchr($file, '.'), 1); 解析:strrchr($file, '.')     strrchr() 函数查找字符串在另一个字符串中最后一次出现的位置,并返回从该位置到字符串结尾的所有字符 2.$file = 'x.y...
substr() mb_substr() mb_subcut区别与联系
web 0 0
2115 0 2018-10-31 PHP
string substr ( string $string , int $start [, int $length ] ) substr() string:输入字符串。 start: //(1)为非负数,返回的字符串将从 string 的 start 位置开始, 至字符串结尾 $rest = substr("abcdef", 1); ...
html代码过滤并截取
taotaoit 0 0
1925 0 2018-10-31 PHP
//html代码过滤并截取: $str1 = "<strong>培训机构通讯</strong>"; $str2 = substr(strip_tags($str1),0,6); echo $str1; //<strong>培训机构通讯</strong> echo "<br>"; ...
php字符串截取
web 0 0
2304 0 2017-07-26 PHP
方法1: 获取字符串位置strpos(string,find,start),例如: <?php echo strpos("Hello world!","wo"); ?> 输出6 截取字符串substr(string,start,length), 其中start的参数  正数 - 在字...
php错误 You have an error in your SQL syntax;check the manual that corresponds to your MySQL
taotaoit 0 0
2267 0 2017-06-09 PHP
做php网站安装程序的时候出现这个错误You have an error in your SQL syntax;check the manual that corresponds to your MySQL,这个错误基本是sql语句不合法造成的,但是检查半天不知道哪不合法。 最后打印sql语句发现,从记事本中读取的第一条sql语...
php把字符串变成数组(没有分隔符)
taotaoit 0 0
3123 0 2017-05-17 PHP
$str1='把中文转换成数组'; $str2='abcdefg'; $str3='0123456789'; echo mb_strlen($str1,'utf-8');//输出字符串的长度,当然用utf-8编码, //mb_strlen — 获取字符串的长度,(PHP 4 >= 4.0.6, PHP 5, PHP 7) func...
关于本站

“最难不过坚持”

本人承接扒站仿站,php网站维护,病毒查杀,网站编辑,网站改版,html制作

有需要网站维护,改版,病毒查杀,网站编辑,网站备案,html制作等相关的工作可以联系我。
本人有多年相关工作经验,也可提供免费咨询,交个朋友。
有需要探讨问题的朋友,也可以加我微信,共同探讨!
微信:15011482830 QQ:408917339

6580109 2620 39
最新评论
https://jueru.net/
评 留言
:weixiao:
评 留言
:shuijiao: :weiqu: :zhenbang: :leng:
评 留言
:yiwen: :yiwen: :yiwen: :yiwen:
评 EasySass: could not generate CSS file. See Output panel for details.
这个业务逻辑多少都有点奇怪了,阅读浏览次数增值在新闻详情页的控制器方法里setInc,这怎么还写进模型事件里了。如果非要用onAfterRead也可以,把新闻文章的内容单独分出来一个news_content表,然后把它和news做关联,然后给news_content表的onAfterRead事件做增值处理,这样点进新闻页内查询到文章内容时才会触发它。
评 TP6模型事件-查询后onAfterRead不好用
文章标签更多
ThinkPHP (254)
Mysql (58)
DedeCms (33)
jQuery (67)
证件照 (1)
setInc (4)
setDec (4)
onclick (5)