封裝cookie
封裝三個函式
setcookie() -- 建立 cookie
getcookie() -- 獲取 cookie
removecookie() -- 刪除 cookie
function setcookie(name,value,iday)
//a=12; b=5; c=8; d=99
function getcookie(name)
}//另一種可能,使用者第一次來**,還沒有cookie,所以肯定什麼也找不到。所以在迴圈一次後就直接return 乙個字串,告訴使用者什麼也沒找到。
return "";
}function removecookie(name)
物件導向的三個特性 封裝
物件導向的三個特性 封裝 繼承 多型 1.封裝 目的 讓類更加安全,不讓外界直接訪問類的成員 具體做法 將成員設為私有 訪問修飾符 class ren r new ren echo r age 訪問不到 造成員方法來操作變數 class ren function getage r new ren r...
函式的三個角色
function fn fn.prototype.getx function var f1 new fn this 是 f fn.a 1000 作為乙個普通物件 f.num undefined f.a undefined var res fn this 是 window普通函式 它本身就是乙個普通的...
map reduce zip三個內建函式
def printline content,sign 列印一條分割線 param content 分割線中你想要填寫的內容 格式 例如 解壓 param sign 用什麼符號分割 return print format sign 50,end print content,end print form...