Modify time format:
Date ("Y-m-d", strtotime ($ list ['pubdate']);
Learning explanation: put the time in strtotime as the timestamp and convert the format with date (). The following two functions are written:
PHP strtotime () functionThe
CopyCodeThe Code is as follows: $ A = 1;
$ B = 2;
$ T = array (
Array ('A', 'string', $ field ['a']), // name
If ($ A = $ B) {array ('B', '1 ')}
);
Print_r ($ t );
Exit;
1. The length of the array is long. Not noticed2. The development code
Problem description
When loading the page, quickly move the cursor to the search bar. After the page is loaded, a search prompt is displayed after the search bar is initialized. at this time, any input content will be part of the Search Prompt, not
I found a good comrade who debugged the PHP source code: PhP debug tools
Its project address: http://freshmeat.net/projects/php-debug-tools/File: http://freshmeat.net/urls/7c58ae3fecce5763e7546b958d36e082Version 1.03
The environment here is
[/Code]
Global $ count;
$ COUNT = 1;
If (! Isset ($ _ cookie ["visittime"]) {setcookie ("visittime", date ("Y-m-d h: I: s "));
Setcookie ("visitcount", 1); echo "welcome to visit your website for the first time! ";
}
Else {
Setcookie
Example
Break is used to jump out of the current execution cycle and stop executing the loop.
CopyCodeThe Code is as follows: $ I = 0;
While ($ I If ($ arr [$ I] = "stop "){
Break;
}
$ I ++;
}
?>
Continue immediately stops the current
Error code: Parse error: syntax error, unexpected $ end in H: \ wamp \ www \ testing \ test \ 2.1.4.php on line 16
Error Source Code:
Copy codeThe Code is as follows: $ Str = test string
test string
test string
EOD;
Echo $ str;
// Defines
Copy codeThe Code is as follows: function arrayToObject ($ e ){
If (gettype ($ e )! = 'Array') return;
Foreach ($ e as $ k => $ v ){
If (gettype ($ v) = 'array' | getType ($ v) = 'object ')
$ E [$ k] = (object) arrayToObject ($ v );
}
Return (object)
Rules for writing regular expressions:"/The rule must be written in the middle of two slashes./".
(.: Decimal point) is used to match all characters except line breaks.
(\ S: Lower-case backslash (s) is used to match a single space character,
1. Test method: www.xxx.com/test.php? Content_id = custom, for example, 44
Copy codeThe Code is as follows: $ content_id = array (); // 1. Create an array
$ Content_id [] = $ _ GET ['tentid']; // 2. Insert the ID to the array.
If (isset ($ _ COOKIE
Today, we use a simple example to describe the usage of getText in PHP (getText is a series of tools and library functions that help programmers and translators develop multilingual software ), so as to implement PHP i18n.
Now, let's assume that we
It may sound a little confused. Let's use several examples to illustrate:
Copy codeThe Code is as follows: Echo 'example :';
Fastcgi_finish_request ();
Echo 'to be, or not To be, that is the question .';
File_put_contents('log.txt ', 'survival or
At the beginning, I planned to use foreach for origin, but I found that I was not successful. oo was not enough, so I couldn't write oo ······
After the study, we decided to use the for loop. The Demo code is as follows:
Copy codeThe Code is as
Copy codeThe Code is as follows: // the so-called broken word (word break), that is, the place where a word can be broken during the conversion. This function truncates the string at the break.
// Please acknowledge use of this code by including
The regular expressions that we all call are basically Perl-Compatible Regular Expressions. POSIX regular expressions are basically not used. Therefore, it is not recommended to use them since PHP5.3. Related functions may be deleted in the next PHP
Class Code:
Copy codeThe Code is as follows: Class Router
{
Public function getRouter ($ types = 1)
{
If (isset ($ _ SERVER ['path _ info'])
{
$ Query_string = substr(str_replace(array('.html', '.htm', '. asp', '//'), '', $ _ SERVER ['path _ info']),
Now let's briefly describe how to develop PHP extensions in WINDOWS:
The first software to be prepared is:
Cygwin installation path e: \ app \ cygwin
Visual studio C +++ 6.0,
Modify the environment variables and set the installed PHP path to the
Copy codeThe Code is as follows:
greengnn codes
GO
// Obtain the keyword and source search engine name
$ Search_url = isset ($ _ GET ['url'])? $ _ GET ['url']: ''; // indicates the input address./* $ Search_url = urldecode ($
Use if (isset ($ _ POST ['submit ']) {
}
Difference between if ($ _ POST [submit]) and if (isset ($ _ POST [submit]) when submitting a form
The first method produces a warning, and the second method is more rigorous.In addition, it is best to
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