legend2---开发日志16
生活随笔
收集整理的這篇文章主要介紹了
legend2---开发日志16
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
legend2---開發(fā)日志16
一、總結(jié)
一句話總結(jié):
編程敲代碼,一定要把 關(guān)系弄清楚,關(guān)系不弄清楚,很容易敲錯(cuò),比如:如何求無限級(jí)分類的博客的數(shù)據(jù)的數(shù)目
弄清楚關(guān)系式:自己總數(shù)量=孩子總數(shù)量+自己的數(shù)量
孩子總數(shù)量=每個(gè)孩子自己的+每個(gè)孩子的孩子的。
?
1、創(chuàng)建模板表之后,很多內(nèi)容都可以用緩存代替數(shù)據(jù)庫,比如?
比如每日福利(任務(wù)),商店物品,尋寶物品等等
?
2、題目關(guān)鍵詞如果是非純文本最容易發(fā)生的錯(cuò)誤是什么,及如何解決?
標(biāo)簽無法閉合,引號(hào)無法閉合:導(dǎo)致引號(hào)或者雙引號(hào)會(huì)影響其它很多標(biāo)簽,把其它很多標(biāo)簽當(dāng)成引號(hào)里面的內(nèi)容
解決:不顯示的span標(biāo)簽里面內(nèi)容時(shí)單引號(hào)和雙引號(hào):<span style="display: none">'"</span>
?
3、英雄列表中很容易出現(xiàn)圖片 卡位 (有些位置放不下圖片)的情況,如何解決?
為英雄的img指定固定的寬度高度即可
<img v-bind:src="hero.th_picture" class="img-circle" style="box-sizing: border-box;width: 60px;height: 60px;" alt="User Image">?
?
4、ajax中返回信息時(shí)$back_data['operation_num_info']=''; 的意義是什么?
可以向頁面返回具體信息,比如丹藥使用等級(jí) 等等
?
5、php中0=='reiki_exam'的值是true還是false?
為true,所以可以將前面的0轉(zhuǎn)化為字符串
?
6、vue如何根據(jù)變量的值來加載不同的樣式(刪除的博客用紅色顯示)?
v-bind:class="{'text-danger':per_blogLoadLog.bll_is_delete}"
<tr v-for="per_blogLoadLog in blog_load_logs" v-bind:class="{'text-danger':per_blogLoadLog.bll_is_delete}">?
?
7、htmlspecialchars_decode的作用是什么?
用腦子:函數(shù)見名知意:html幾個(gè)大字
?
8、stripslashes的作用是什么?
用腦子:什么符號(hào)叫slashes
?
9、如何求無限級(jí)分類的博客的數(shù)據(jù)?
弄清楚關(guān)系式:自己總數(shù)量=孩子總數(shù)量+自己的數(shù)量
孩子總數(shù)量=每個(gè)孩子自己的+每個(gè)孩子的孩子的。
public static function get_newBlogCategory($blog_category,&$new_blog_category,$parent_id=0,$level=0){$blog_num=0;foreach ($blog_category as $key=>$val){if(intval($val['bc_top_parent_id'])==$parent_id){$val['level']=$level;$blog_num+=$val['bc_num']; //孩子本身的和//unset($blog_category[$key]);$blog_num_children=self::get_newBlogCategory($blog_category,$new_blog_category,$val['bc_id'],$level+1);$blog_num+=$blog_num_children;//孩子的孩子的和$val['bc_num']+=$blog_num_children; //自己的等于孩子的總和加上自己的$new_blog_category[]=$val;}}return $blog_num; }?
?
10、php拆分字符串?
explode(" ",$str)
<?php $str = "Hello world. I love Shanghai!"; print_r (explode(" ",$str)); ?>?
?11、php數(shù)組去重?
$idArr=array_unique($idArr);
?
?
?
二、內(nèi)容在總結(jié)中
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/Renyi-Fan/p/10854529.html
總結(jié)
以上是生活随笔為你收集整理的legend2---开发日志16的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php网站怎么写一个聊天
- 下一篇: Codeforces Round #56