Copy codeThe Code is as follows:Function custom (){}
Class custom {Public function index (){
}}Print_r (get_define_position ('custom '));
/***/* @ Param string $ name function name or Class name* @ Return array*/Function get_define_position ($ name )
Include () and require (): The statement includes and runs the specified file.Include () generates a warning and require () causes a fatal error. In other words, if you want to stop processing the page when a file is lost, use require (). This is
After j is input, the ajax effect is triggered. Data with j in the corresponding name is obtained from the background and displayed in suggestions.
The code is implemented as follows:
Ajax requires three files: one is an html form file, the other is
1. What is a namespace?A namespace is a special scope that contains identifiers in this scope and is also an identifier. You can map the namespace to the operating system directory. A namespace is equivalent to a directory. The classes, functions,
When URL parameters are known, we can use $ _ GET to obtain the relevant parameter information ($ _ GET ['name']) according to our own situation, how can I obtain the parameter information on the URL in an unknown situation?
First, use the $ _
When integrating html pages into the ci framework, loading css and js failed. After half a day, I found that the ci framework is the portal framework, all requests to files in the framework must go through the index. php processing is complete. When
We can use the following code to test:Copy codeThe Code is as follows: $ Filename = 'test.txt ';If (is_file ($ filename )){Echo "$ filename exists! \ N ";} Else {Echo "$ filename no exists! \ N ";}Sleep (10 );If (is_file ($ filename )){Echo "$
Write a class to test the execution time of the target function. The following is the class definition code:
Copy codeThe Code is as follows:/*** Class EfficiencyTester* Efficiency tester: test the function running time* @ Version 1.0 2013.04.13* @
Remember that json_encode returns a string, while json_decode returns an object.
Determine that the data is not in JSON format:
Copy codeThe Code is as follows:Function is_not_json ($ str ){Return is_null (json_decode ($ str ));}
Determine that
This concept was first introduced in Drupal and was a bit unaccustomed at the beginning-why not write a closed tag? This is not perfect. It is not suitable for people with obsessive-compulsive disorder! Later, I encountered a problem caused by TAG
1. Create a table first.
Copy codeThe Code is as follows:Create table if not exists 'tp _ image '('Id' int (11) not null AUTO_INCREMENT,'Image' varchar (200) not null,'Create _ time' int (11) not null,Primary key ('id ')) ENGINE = MyISAM default
1. Add the following configuration in config. php of Home (your project name ):
Copy codeThe Code is as follows:Return array (// 'Config maps '=> 'configuration value''Lang _ SWITCH_ON '=> true, // enable the Language Pack Function'Lang _
Solution: Use js to encode the Chinese characters in the URL.
Copy codeThe Code is as follows:The following figure shows the validity of the link:
Reference: http: // 127.0.0.1/shop/product_list.php? P_sort = PHP % u5F00 % u53D1 % u8D44 % u6E90 %
In actual projects, we often encounter the path to get the previous page address. You can return to the previous page to useCopy codeThe Code is as follows: This is operated through JS.In such a scenario, when the user needs to exit the account, you
During PHP development, when you use empty to check the results returned by a function, the following error occurs: Fatal error: Can't use function return value in write context.
For example, the following code:Copy codeThe Code is as follows:Echo
There are two functions in PHP to calculate the number of strings.One is strlen and the other is mb_strlen;Let's take a look at the definitions in the manual.StrlenStrlen-get the string lengthInt strlen (string $ string)Returns the length of a
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