How PHP Gets the length of the array, using the PHP function count (), or sizeof ()
For example:
The code is as follows
Copy Code
$arr = Array (' 0 ', ' 1 ', ' 2 ', ' 3 ', ' 4 ');echo count ($arr);Output 5$arr = Array ('
About session Processing
HTTP is a stateless protocol that shows that each request is handled independently of the previous or subsequent request, but in order to be able to adjust user-specific behavior and preferences, there is a practice of
PHP often handles arrays of unknown depths, which are generally handled recursively, but are well known for the depth of the array.
Get array Length:
The code is as follows
Copy Code
/*** @description Get array length* @
Code is the best language.
The code is as follows
Copy Code
#demo for Prevent CSRF /*** ENC*/function Encrypt ($token _time) {return MD5 ('!@##$@$$#%43′. $token _time);} $token _time = time ();$token = Encrypt ($token
This is a brief introduction to compiling PHP and its extended memcache, and it is recommended that you read the official document (address) before reading the following. Here we take php5.3 as an example.
First, the compilation environment
Select
Name: Random_password ()## Author: Chrishent, Jeremyasklaft## Date: May 1999, October 2000## use: Returns a random word used as a password. Vowels and consonants# is alternating to a (hope) pronouncable, so# an unforgettable result.## usage: $
PHP programmers are most likely to make 10 errors (turn)PHP is a great web development language, flexible language, but see the PHP programmer repeatedly made some mistakes. I did the following list, listing the 10 bugs that PHP programmers often
How to attack, do not explain this (also do not ask me), mainly talk about how to prevent. First, cross-site scripting attacks are due to the lack of strict filtering of user input, so we have to intercept the possible dangers before all data enters
There are various types of codes commonly used in development, such as uft8-> gbk to utf8 traditional to simplified to traditional utf8 to unicode gbk to pinyin Ascii to pinyin, etc./*** Utf8 to gbk* @ Param $ utfstr*/Function utf8_to_gbk ($ utfstr )
This section describes some common regular expressions, such as regular expression verification of date, number, phone number, and time format.Regular Expression Matching Chinese characters: [u4e00-u9fa5]Note: matching Chinese characters is really a
Mt_rand () returns a random integer using the mersenne twister algorithm.SyntaxMt_rand (min, max) descriptionIf the optional parameters min and max are not provided, mt_rand () returns a pseudo-random number between 0 and rand_max. For example, if
*/ The code is as follows:Copy code Class template{Var $ temp; // file name of the template page read (including path)Var $ html; // The html file name to be generated (including the path)Var $ err; // error codeVar $ test; // data streamVar $
$ Dir = opendir ("images ");// List objects in the images DirectoryWhile ($ file = readdir ($ dir ))! = False) {Echo "filename:". $ file. " "; }Closedir ($ dir );// Check the modified directory browsing implementation and use the table browsing
Definition and usageError_reporting () sets the php error level and returns the current level.SyntaxError_reporting (report_level) if the level parameter is not specified, the current error level will be returned. The following items are possible
$ Days = date ("y-m-d ");// Method 1 positive verification date The code is as follows:Copy code $ Reg = "/d {4}-d {2}-d {2 }/";Preg_match ($ reg, $ days, $ arr );Print_r ($ arr ); // Method 2 use cehckdate for verification The code is as
Compiling PHP will inevitably lead to errors. In fact, it is not difficult to solve the problem. The most difficult solution is to have a blank page. Let's think about it. If an error occurs when you write PHP, you can correct it according to the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service