PHP var_dumpA function is used to determine the type and length of a variable and output the value of the variable. If the variable has a value, it is the value of the variable and returns the data type.Let's look at the var_dump Syntax:
Note:Unlike other object-oriented
Programming LanguageIn PHP, the class cannot use the final modifier for an attribute variable.
If you want to declare an attribute as a constant, you can use the const keyword, without using the dollar symbol as
PS:1. Catch PHP syntax errors2. Serious errors
Normal set_error_handle cannot capture these two types of errors. This is a technique for capturing these errors.
Copy codeThe Code is as follows: // test. php page
Error_reporting (0 );
We want to create an unlimited product category.
First, the database field is:Id ---------- commodity primary key id
Fid ---------- product parent id
Name ---------- Product name
The final output array format is
Copy codeThe code is as follows:
First, let's talk about the requirement: the database has four fields: id, volume, edition, and name. The query results must be sorted in descending order of volume + edition.The following describes the array_multisort function.Array_multisort ()
Definition and usageThe stripos () function returns the position where the string first appears in another string.
If this string is not found, false is returned.
SyntaxStripos (string, find, start)
Parameters
Description
String
Similar to basic identity authentication, you can use PHP Web pages to process HTTP request header fields to match digest authentication information. For example, the following code uses the header () function to require the client to use Digest for
It is really difficult to distinguish interfaces from abstract classes. They are very similar to each other, and there is no defined logic for methods. They are all intended or inherited for subclasses. To distinguish the two, just remember one
Preface:FCKeidtor is a foreign multi-language editor. You can simply modify its configuration file to support applications that currently use common Web development languages, next, let's talk about the specific configuration process of the latest
As follows:
Copy codeThe Code is as follows: /**
* Xml2array () will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
* Arguments: $ contents-The XML text
* $ Get_attributes-1 or 0. If
Several PHP algorithms involve the following examples.PHP bubblePHP binaryEvaluate the prime number in PHPPHP multiplication table
PHP Bubble Method example
Copy codeCode: // PHP bubble from small to large
Function maopao (& $ arr)
{
If (! Empty ($
The following php functions are the most commonly used project development functions of it Power. These functions are used in many projects and are also quite common.
1. processing functions of the Request Interface
Copy codeThe Code is as follows :
The usage of PHP empty (), isset (), and is_null () functions has been discussed a lot, and many materials may not be clear. I will repeat it again here, but I should remember it more deeply, instead of simply using program examples to speak.
The
When logging with PHP, or Ajax request error, You Want To debug. We usually write information to a specified file.
. Then the problem is handled according to the corresponding information.
For example, I like to add the following code in the PHP
Indenting and Whitespace)Use two spaces instead of the tab key for code indent (notepad ++, Eclipse and Other Editors support this configuration );The end of the line should not contain white space characters\ N (Unix line break) should be used
This chapter describes several common internal functions of PHP arrays.
We have already introduced PHP arrays. Create an array using the array () function and delete an array element using the unset () function. In this section, we also need to
Case 1:
Father. php is defined as follows:
Copy codeThe Code is as follows: $ Jack = 1000;
?>
Children. php is defined as follows:
Require ("father. php ");
$ Jack = 123;
Echo $ jack. "/n ";
?>
Php children. phpThe output is 123.If you comment out $
PHP string functions include the character location search function, the sub-character extraction function, the replacement string, the character length, the comparison character function, the array character, and the space.
String functions in PHP
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