1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> |
最新文章
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> |
__construct()构造函数,主要是通过关键字new生成实例的时候,它就会被调用执行。(构造函数不能返回值) __destructor()析构函数,它是在对象被销毁的时候被调用执行的。(对象被销毁时清空资源或者记录日志信息) __get(),__set()访问函数,类属性被访问和操作,访问函数都会被激发。oop思想不鼓励直接从类的外部访问类的属性,所以使用它们可以避免直接对类属性的访问。
__construct() is the constructor, mainly called and executed when an instance is generated with the new keyword. (A constructor cannot return a value.) __destructor() is the destructor, called and executed when the object is destroyed. (It clears resources or writes log information when the object is destroyed.) __get(), __set() are accessor functions; whenever a class property is accessed or manipulated, the accessor functions are triggered. The oop philosophy discourages accessing class properties directly from outside the class, so using them avoids direct access to class properties.
date_default_timezone_set();设置默认时区时间 strtotime()函数,将任何英文文本的日期时间描述解析为 Unix 时间戳 getdate()函数,把生成的时间戳转化为一个数组,包含各个部分。 checkdate()函数,检查日期的有效性 格式 checkdate(月份,日期,年份) mktime()函数,取得一个日期的时间戳 格式 mktime(小时,分钟,秒,月份,日期,年份) strftime()函数,把时间戳格式化为日期和时间 格式 strftime(格式,时间戳) gmstrftime()函数和strftime()函数用法一致,只是gmstrftime()函数是显示标准的GMT时间 笔者遇到过日期和时间格式符,%Z显示的中文编码为GBK而我主体用的是utf8,所以只能转码用 iconv()函数 格式 iconv(原字符编码,要转换成的字符编码,转换目标) 
date_default_timezone_set(); sets the default timezone time. The strtotime() function parses any English textual datetime description into a Unix timestamp. The getdate() function turns the generated timestamp into an array containing each part. The checkdate() function checks whether a date is valid, format checkdate(month,day,year). The mktime() function gets the timestamp of a date, format mktime(hour,minute,second,month,day,year). The strftime() function formats a timestamp into a date and time, format strftime(format,timestamp). The gmstrftime() function is used the same way as the strftime() function, except that gmstrftime() displays standard GMT time. I once ran into a date and time format specifier: %Z displayed Chinese encoded as GBK while the rest of my site used utf8, so I could only convert the encoding with the iconv() function, format iconv(original character encoding,character encoding to convert to,conversion target). 
php开发中数组是经常性的用到 那就介绍一下一维数组中的排序函数 sort()函数,默认排序从低到高排列 asort()函数,根据数组元素的值升序排列 ksort()函数,根据数组元素的键值,也就是关键字的升序排列 rsort()函数正好和sort()函数相反 arsort()函数正好和asort()函数相反 krsort()函数正好和ksort()函数相反 array_unshift()函数,向数组中与添加元素 array_unshift(目标数组,要添加的元素) array_push()函数,向数组中添加元素,以实现先进先出 array_unshift(目标数组,要添加的元素) array_shift()函数,删除目标数组的头一个数组元素 array_shift(目标数组) array_pop()函数,删除目标数组的最后一个数组元素 array_pop(目标数组) array_key_exists()函数专门针对联合数组的‘键名’进行查询 array_search()函数专门针对联合数组的‘元素值’进行查询 array_keys()函数是取得数组‘键值’ array_values()函数是取得数组‘元素值’ count()函数,为统计数组的元素个数 array_count_values()函数,为统计数组的元素值个数(只能用于一维数组) array_unique()函数实现数组中元素的唯一性,也就是去掉数组中重复的元素 array_flip()函数调换数组中的键值和元素值位置,如果有重复的键值则覆盖键值,显示最后一次赋值的键值 serialize()函数,数组序列化 unserialize()函数,数组反序列化
Arrays are used constantly in PHP development, so let me introduce the sorting functions for one-dimensional arrays: the sort() function, which by default sorts from low to high; the asort() function, which sorts in ascending order by the array element values; the ksort() function, which sorts in ascending order by the array element keys, that is, the keywords; the rsort() function, which is exactly the opposite of the sort() function; the arsort() function, which is exactly the opposite of the asort() function; the krsort() function, which is exactly the opposite of the ksort() function. The array_unshift() function adds an element to the array array_unshift(target array, element to add) The array_push() function adds an element to the array to implement first-in-first-out array_unshift(target array, element to add) The array_shift() function deletes the first array element of the target array array_shift(target array) The array_pop() function deletes the last array element of the target array array_pop(target array) The array_key_exists() function is specifically for querying the ‘key name’ of an associative array The array_search() function is specifically for querying the ‘element value’ of an associative array The array_keys() function retrieves the array ‘keys’ The array_values() function retrieves the array ‘element values’ The count() function counts the number of array elements The array_count_values() function counts how many times each array element value occurs (it can only be used on one-dimensional arrays) The array_unique() function makes the array elements unique, that is, it removes duplicate elements from the array The array_flip() function swaps the positions of the keys and the element values in the array; if there are duplicate keys, the key is overwritten and the value from the last assignment is shown The serialize() function serializes an array The unserialize() function unserializes an array
String statistics
Calculating string length comes up often in PHP development; the function you need is strlen(). For counting the words in a string there’s str_word_count() (it only works on ASCII English words)
Removing spaces
In many cases PHP development has to take user convenience into account — for example, what if someone accidentally types an extra space when entering their username? Then you use the space-clearing functions: ltrim() removes the spaces at the left end of the string, rtrim() removes the spaces at the right end of the string, and trim() removes the leading and trailing spaces on both sides at the same time. You can look for the pattern in these three functions: trim clears both the left and the right, so in ltrim the l is like left, meaning it clears on the left. Likewise for the right.
无意间把我的zend studio 10.6.1升级成11.0.2了,又要重新破解。 悲催,只好百度求助,竟然让我找到了,在此分享一下。 补丁地址:http://download.csdn.net/download/w15875510692/8140777
I accidentally upgraded my zend studio 10.6.1 to 11.0.2, and now I have to crack it all over again. Miserable — so I had no choice but to ask Baidu for help, and amazingly enough I found it. Sharing it here. Patch address: http://download.csdn.net/download/w15875510692/8140777
1 | <?php |
1 | <?php |
文件 goods_list.htm privilege.php privilege.php找到set_admin_session($row[‘user_id’], $row[‘user_name’], $row[‘action_list’], $row[‘last_login’]);在其上下分别添加 $admin_zk=explode(“||”,$row[‘adminzk’ ]);上 $_SESSION[‘adminzk’] = $admin_zk[2];下 在查找 if(!empty($ec_salt))把sql预计加上字段adminzk 在goods_list.htm查找 {$goods.shop_price} 把 {$goods.shop_price} 改为{if $goods.shop_price=$goods.shop_price*$smarty.session.adminzk/100} {$goods.shop_price} {/if} 其中折扣adminzk在管理员列表里格式###|###|###|###|###||###||###
File goods_list.htm, privilege.php privilege.php — find set_admin_session($row[‘user_id’], $row[‘user_name’], $row[‘action_list’], $row[‘last_login’]); add the following above and below it respectively: $admin_zk=explode(“||”,$row[‘adminzk’ ]); on top, $_SESSION[‘adminzk’] = $admin_zk[2]; below. Then find if(!empty($ec_salt)) and add the field adminzk to the SQL statement. In goods_list.htm find {$goods.shop_price} and change {$goods.shop_price} to {if $goods.shop_price=$goods.shop_price*$smarty.session.adminzk/100} {$goods.shop_price} {/if}. The discount adminzk is stored in the administrator list in the format ###|###|###|###|###||###||###
不是春天也不是秋天,每年都是一个天。
没有妒忌,没有贪婪,只有静静的相伴
山不在有,路不再远,而我还是满脸无言
有着四季给予的抚爱,却总是缠缠绵绵
透过朦胧的小道,我看到门的边缘
其实,我在边,我的世界在变。
It’s neither spring nor autumn, and every year is the same sky.
No envy, no greed, only quiet companionship
The mountains are no more, the road is no longer long, and still my face is wordless
With the caress the four seasons give, yet always lingering on and on
Through the hazy little path, I see the edge of the door
In fact, I’m at the edge, and my world is changing.
登陆后管理员查看会员列表会发现邮箱验证这块必须客户验证才有效果,不过大多数客户不愿意去验证,就改为管理员可操作吧 因为邮箱验证时判断客户验证状态0或1来选择显示图片对和错的,也刚好想到,在商品列表里有上架、下架,是否新品……刚好可以吧代码复制过来作参考 从商品列表里获知是js验证传输数据的,直接找到js文件,从中打印一下看看路径。根据路径在会员文件里更改数据 商品列表代码
After logging in, when the administrator looks at the member list they’ll find that the email verification part only works if the customer verifies it themselves, but most customers are unwilling to go and verify, so let’s change it so the administrator can do it. During email verification the customer’s verification status of 0 or 1 is used to decide whether to show the correct or the incorrect image, and it also occurred to me that in the product list there is put on sale, take off sale, whether it’s a new item… so I can just copy that code over as a reference. From the product list I learned that it’s js that validates and transmits the data, so I went straight to the js file and printed something out of it to see the path. Then, following the path, change the data in the member file. Product list code