Thanks to csdn
CommunityHsboy user's post
Original article:
Hsboy (PhP it!) on the 6th floor !) The score is 60 at 18:44:07.
Hypothesis1. The content you want to edit with FCKeditor is passed to the template through $ smarty-> assign ('content'
1. Comparison of examples
Example 1:
CopyCode The Code is as follows: $ Var1 = 1;
Function Test (){
Unset ($ globals ['var1']);
}
Test ();
Echo $ var1;
?>
Because $ var1 is deleted, nothing is printed.Example 2:Copy codeThe Code is as follows: $
PHP variable to Javascript variable:
Copy codeThe Code is as follows:
Form variable to Javascript variable:Copy codeThe Code is as follows:
PHP variable to Form variable:Copy codeThe Code is as follows: "> // PHP code inside HTML !!
Javascript
So, your jQuery might be something like .....
Copy codeThe Code is as follows: $. ajax ({
Url: 'query. php ',
Data: {id: 10 },
Datatype: json
Success: function (results ){
If (results. msg = 'success '){
For (var I in data ){
$ ('# Content'). append
Mysqli is only available after php5. If you have not enabled the extension, you can open your php. ini configuration file.Find the following statement:; extension = php_mysqli.dll and change it to extension = php_mysqli.dll.Compared with mysql,
Copy codeThe Code is as follows: select FROM_UNIXTIME (pubtime, '% Y-% m') as pubtime, count (*) as cnt from articles group by FROM_UNIXTIME (pubtime, '% Y-% m ')
PHP articles are archived by date (day) SQLCopy codeThe Code is as follows: select
Select collationproperty ('Chinese _ PRC_Stroke_CI_AI_KS_WS ', 'codepage ')
The return value is 936, Which is GBK encoding.
GBK, simplified Chinese, 936950 traditional Chinese BIG5437 US/Canada English932 JapaneseKorean 949866 Russian65001
Eval
Enter the value in the string.
Syntax: void eval (string code_str );Return Value: NoneFunction Type: Data Processing
Description
This function can be used to substitute variable values in a string for processing database data. The code_str
How to install Php
Php version Selection
Php in windows (php5.4.7) has two versions:
VC9 x86 Non Thread Safe Non-Thread security model run in FastCGI ModeVC9 x86 Thread Safe Thread security runs in ISAPI Mode
Installation ProcessYou only need to
Principle of Bubble Sorting
① Put all the numbers to be sorted into the work list.② From the first number in the list to the second to the last number, check one by one: if the number on a certain digit is greater than the next digit, then it is
_ Autoload usage Method 1:
This method is most often used. Find the class file based on the class name, and then require_one
Copy codeThe Code is as follows: function _ autoload ($ class_name ){
$ Path = str_replace ('_', '/', $ class_name
But how can we traverse the binary tree array produced by this method? My practice is as follows:
Copy codeThe Code is as follows: Function preTree ($ cat ){
Foreach ($ cat as $ c ){
?>
"> :
"> : If (isset ($ s ['childrens']) {?>
Not much nonsense.
Php for Smarty
Copy codeThe Code is as follows: * Name: time_ago
* Purpose: Specify the timestamp as a representation of the current time.
* Per second in 1 minute
* Display by minute within one hour
* Display on time within 1 day
1. Single quotes
Note:
Add single quotation marks directly behind the URL. The single quotation marks must not be filtered (gpc = off) and the server returns an error message by default.
Eg:
Www.xxx.com/news.php? Id = 149 ′
2. Path of incorrect
Ideas:
1) generate a 32-bit signature string for the Long URL md5, which is divided into four sections, each of which contains 8 bytes;
2) for these four cycles, take 8 bytes and treat them as hexadecimal strings and 0x3fffffff (30 bits 1) and
Copy codeThe Code is as follows: $ A = 3;
$ B = 6;
If ($ a = 5 | $ B = 7 ){
$ A ++;
$ B ++;
}
Var_dump ($ a, $ B );
Trap 1
Consider $ a = 5 and $ B = 7 as $ a = 5 and $ B = 7.Error result: 3, 6
Trap 2
Operator priority. $ a = 5 is assigned
According to the difference between file_exists and is_file and is_dir in PHP, we can basically understand that file_exists = is_dir + is_file in PHP.
Write a program to verify it:
Execute 1000 times, respectively, and record the time
Recently, I was working on a project and encountered an AJAX Chinese garbled problem. After an afternoon of hard work, I finally wrote down my experiences, I hope it will help those who are still stuck with this problem and have a headache.
As we
In fact, this is not difficult, because the CI just started, so it still took some twists and turns. Fortunately, there is a manual.
Find the database configuration file and add the connection information of a new database. $ Config [XX].In 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