CopyCode The Code is as follows:
common numeric judgment functions
// Determine the Array
$ Colors = array ("red", "blue", "green ");
If (is_array ($ colors ))
{
Print ("colors is an array". " ");
}
// Double-precision data Determination
$
The following sectionCodeThe timestamp provided by most people on the Internet is a reality. At first glance, it can only be said that the current date is obtained, not the timestamp. Do not explain it more!
Copy code The Code is as follows: $ now
(Note that it is not a client jump using header, js, or other methods)
Copy codeThe Code is as follows: function server_transfer ($ dest)
{
Global...; // list the variables on the current page or custom global variables you want to use on the
Developers, database architects, and system administrators should take preventive measures before deploying PHP applications to the server. Most of the preventive actions can be completed through several lines of code or slightly adjusting the
Copy codeThe Code is as follows: Require_once ("mssql. class. php ");
// 1. Create a class and connect to the database
$ Db = new mssql ("dns = aaa; uid = sa; pwd = sa; dbname = test ");
// 2. Connect to the database
$ Conn = $ db-> config ("dns
Ceil-integer in one methodDescription
Float ceil (float value)
Returns the next integer of no less than value. If the value has a decimal part, it is entered in one place. The type returned by ceil () is still float, because the float value range is
In this case, the is_scalar built-in function is used.
Is_scalar -- checks whether the variable is a scalar.
Scalar variables refer to variables that contain integer, float, string, or boolean, while array, object, and resource are not scalar
Php. ini-recommended has a higher security level than php. ini-dist. By default, display_errors is set to off, magic_quotes_gpc is set to Off, and so on. The relative php. ini-dist is the default configuration. Therefore, if you only want to perform
Interfaces can only define constraints in php. Although they are not as intuitive as c #/java, APIs can improve program Scalability Based on oop encapsulation requirements, for example, implement the proxy design mode.
Copy codeThe Code is as
1. strstr-first appearance of the search string
String strstr (string $ haystack, mixed $ needle [, bool $ before_needle = false])Note 1: $ haystack is the string and $ needle is the string to be searched. This function is case sensitive.Note 2:
1. json_decode ()
Json_decode(PHP 5> = 5.2.0, PECL json> = 1.2.0)
Json_decode-encode strings in JSON format
DescriptionMixed json_decode (string $ json [, bool $ assoc])Accept a JSON string and convert it to a PHP variable
Parameters
JsonA string in
I. Portal
The entry file can be a single file or multiple files. Currently, I use multiple files, but the content of the entry file is basically the same. This serves as the basis for modifying other entry methods in the future,
Copy codeThe Code
The technology is not refined. If you have any mistakes, please point out that I will correct them.
Copy codeThe Code is as follows: header ('content-Type: text/html; charset = UTF-8 ');
Echo ' ';
Function var_array ($ array)
{
Echo ' ';
Var_dump ($
Copy codeThe Code is as follows: $ A = array (
'A', 'B', 'C'
);
Require 'template/demo. php'; // reference the template
?>
Template file:Copy codeThe Code is as follows: template test
Copy codeThe Code is as follows: Key Value: // Array
The filter_var () function filters variables using the specified filter.
If the operation succeeds, filtered data is returned. If the operation fails, false is returned.
Syntax
Filter_var (variable, filter, options) variable: required. Specifies 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