It's good to judge whether an array is empty or not. Count if the output is 0 then the array is empty and the following is the simple test code. PHP to determine whether the array is empty code$arr = Array ();echo count ($arr);?>The array is empty
The is only so called "advanced" usage because I have not mastered the most basic usage of the switch, so, the following is actually the basic usage of it! The Switch statement is similar to a series of IF statements that have the same
PHP Merge Array We can use the Array_merge () function, and the Array_merge () function returns a federated array. The resulting array begins with the first input array parameter, appended in the order in which the following array parameters appear.
Constructor usage
HP 5 Allowable developers define a method as a constructor in a class. Classes with constructors Call this method each time a new object is created, so it is ideal to do some initialization before working with the object.
Note:
The way to open SSL in PHP is very simple, first find the php.ini file, the extension=php_openssl.dll before the annotation symbol ";" Remove, and then restart Apache to take effect!
Some friends do this but found that SSL is not effective, then
That's probably what I did:
(1) Generate user authentication tokenAfter the user logs in I will generate a token that token may consist of the following information: Username+ip+expiration+salt "Just an example", then encrypt the composition
Install method One, use wget to install directly
System: CentOS 5.5Required Packages: libmemcached-1.0.15.tar.gzMemcached-2.1.0.tgz1. Pre-Installation Preparation
The code is as follows
Copy Code
wget
PHP Tutorial Design mode builder mode and adapter (adapter mode)
Adapter mode** Convert the interface of a class to another interface that the customer expects, and those classes that are not compatible to work together can work together
Builder
Because of the checkbox specificity, so we have to get its value, in my language is not the same, in the PHP tutorial we are in the form of an array, and the use of traversing his value, there are a number of examples below.
checkbox
How to generate static Web pages in PHPSee a lot of friends in various places post asked PHP to generate static article system method, previously had done such a system, and then talk about some views, for you to reference. Well, let's look at some
This form of automatic completion function, such as Baidu, Google, Taobao their search function are available, when the user input a content to be based on the condition display related content.
PHP code
Class datafetch{Private $conn,
In fact, many of the methods are very simple, such as
$_files[' userfile ' [' type '] is judged before the file is uploaded.
There is also a getimagesize--get the image size and getimagesize return and the parameters are as follows.
Returns
Also used yesterday to a PHP online questionnaire survey program Oh, customers want to advertise in Sina, so to count the user related information, okay, let's look at the effect page first
Questionnaire Survey 1, Luzhou old cellar tequ How many
PHP and AJAX imitation Live and Google search box
Ajax Live SearchIn the following example of Ajax, we will show the search for life, where the server gets the search results at the same time as the user type.Live Search has many benefits,
Generally, the simplest is to replace the character.For example, str_replace ("#", "-", "dizaz #7 # final "),More advanced is to save and replace the data.Str_replace (array ('#', '$'), "-", "dizaz #7 $ final"), etc,Other methods are the simplest in
The tanh () function returns the hyperbolic tangent.SyntaxTanh (x) parameter descriptionX is required. A number.DescriptionReturns the hyperbolic tangent of x, defined as sinh (arg)/cosh (arg ).*/Echo tanh (-m_pi); // output-0.996272076221Echo "
Definition and usageThe abs () function returns the absolute value of a number.SyntaxAbs (x)*/$ Abs = abs (-3.2); // $ abs = 3.2$ Abs2 = abs (5); // $ abs2 = 5$ Abs3 = abs (-5); // $ abs3 = 5/*Definition and usageThe ceil () function rounds up to
The following describes the introduction and examples.Parse_url ($ str url );Convert a url into an arrayPrint_r (parse_url ("www.111cn.net"); // Parse the url and output the returned array/*Returns a string in special url format to a normal
Php tutorials can be used only in versions later than 5.30, inheriting the features of fast redirection in the previous version (separate classes, all use static calls ), A very important function and attribute can be added to call the modules in
Variable typesGettype ($ var)This function returns the type of the variable. For example, "string", "integer", "boolean", and "floating point value. Before inserting a variable into a strictly typed database domain, this function is generally used
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