First of all, the MySQL character set problem. Windows can be modified by modifying the My.ini in the
PHP code
Copy CodeThe code is as follows:
[MySQL]
Default-character-set=utf8//Client's default character set
[Mysqld]
Default-character-set=utf8
Ob_flush/flush's description in the manual, is to refresh the output buffer, and also need to be used, so it will cause many people confused ...
In fact, the two of them are different objects, in some cases, flush does not do anything at all.
The Ob_
But on the server, many use Linux server, the source program uses UTF-8, so it is easy to produce character encoding problem.
If you just transcode the CSV file to UTF-8 so that there is no problem on the Windows Server,
On RedHat5.5, in the array
I. Several styles of embedding PHP code in Web pagesRecommended for use in standard or short style
Copy CodeThe code is as follows:
Standard Style
Echo ' Hello world! ';
?>
Short style
Echo ' Hello world! ';
?>
two. Four ways to code
PHP Ping Service code actually in the past I have written a class, but, a lot of friends add my friend said, see not quite understand, that is in the form of class, maybe if directly put in the code directly with not very line, today hair can
Here are two ways to crontab.
first, use PHP to execute script in crontab
Just like calling a normal shell script in crontab (specific crontab usage), use a PHP program to invoke the PHP script.
Each hour executes myscript.php as follows:
Copy
Today, when parsing dedecms, the MySQL time field found in Deder is used
' SendData ' int (ten) unsigned not NULL DEFAULT ' 0 ';
Then found this article on the Internet, it seems that if the time field has to participate in
Introduced
The Observer pattern defines a one-to-many dependency on an object, so that when an object changes state, all its dependents are notified and updated automatically!
Design principles
In the Observer pattern, the state of the subject and
One, function prototypes
int Memory_get_usage ([bool $real _usage = false])
Two, version compatible
PHP 4 >= 4.3.2, PHP 5
third, basic usage and examples1, gets the current memory consumption
Copy CodeThe code is as follows:
Echo
Required Tools and Installation:
You must install the following tools and software:
– A shell script that modifies the password;
–sudo access rights;
–apache or LIGHTTPD Web server;
–php Service-side program.
Step 1: Install a shell script
Calling IE in PHP uses the following code:
Copy CodeThe code is as follows:
Browser = new COM ("Internetexplorer.application");
No normal call, direct error:
Copy CodeThe code is as follows:
Fatal error:uncaught exception ' com_exception ' with
How to use
Copy CodeThe code is as follows:
$mysql = new Sqlstr ("Table1");
$mysql->set ("name", "value");
$mysql->set ("name", "1", true);
echo $mysql->insertsql ();
Copy CodeThe code is as follows:
Class Sqlstr
{
Private $param =array
PHP Asynchronous Invocation Implementation methodThere is only one communication between the browser and the server for the non-connected HTTP protocol, the non-connected program is characterized by the client Request server, the service side output
@access
Scope of Use: Class,function,var,define,module
The tag is used to indicate access rights for the keyword: private, public, or proteced
@author
Specify the author
@copyright
Scope of Use: Class,function,var,define,module,use
Specify copyright
Need to remove BOM, put the tool.php file in the attachment to the target directory, and then access the tool.php in the browser!
Copy CodeThe code is as follows:
This file is used to quickly test whether UTF8 encoded files are added to the BOM
There is a function called Strtotime in PHP. Strtotime implementation: Gets the timestamp of a date, or gets the timestamp of a time. Strtotime to parse the datetime description of any English text into a UNIX timestamp [convert system time to UNIX
I'm actually calling a Zend method of accessing the database, using the Fetchall method, but because there is no record in the database, the returned object is null, so I'll tell if the object is null:
Copy CodeThe code is as follows:
if ($obj
Copy CodeThe code is as follows:
Add Ob_start () at the beginning of your service;
Ob_start ();
Here's your code.
Add Ob_end_clean () at the end and output this page to a variable
$temp = Ob_get_contents ();
Ob_end_clean ();
Write file
$fp =
1. Super Simple page CacheIf your project is not based on a CMS system or framework, creating a simple caching system will be very real. The following code is simple, but it can solve a problem for small sites.
Copy CodeThe code is as
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