A small line of change, in fact, different platforms have different implementations, why this, can be the world is diverse. Instead of using/N to wrap lines in the Unix world, Windows uses/r/n to reflect his differences, and more interestingly,
This code is commonly used when we encode some frameworks (such as thinkphp).
M (' User ')->where (array (' ID ' =>1))->field (' name ')->select ();
This is not only conducive to coding, but also can make people "happy". Well, don't say much. Let's
1.1 工厂模式 , factory method or class generation object, not in code directly new
class Factory{
static function getDatabase(){
return new Mysql($host, $user, $pass);
}
}
#使用
Factory::getDatabase();
the function of PHP page jump is to jump one page to another page in the website. For a friend who has just learned the language of PHP, it is the basic method that must be mastered.
Page jumps may be triggered by a user clicking on a link, a
Configure PHP under Windows IIS 6.0, usually with CGI, ISAPI, and fastcgi three configurations, all three of which can run successfully under IIS 6.0, and I'll talk about the difference and performance of these three configurations.
1, the CGI
Today I smoked a morning to look at the previous solution to the memory problem of the code, relatively speaking, I am very dissatisfied with the code optimization program, one import 40,000 of data to make the code so cumbersome, I think this is
This sesison to the database is very simple, is based on the session_id of the database crud operations, mainly used, Session_set_save_handler this method, custom session execution method,
First create the data table
CREATE TABLE ' Sessions ' (
PHP constructors support different number of parameter methods
Principle: Use Func_num_args to get the number of parameters in __construct, and then perform different calls based on the number of parameters. Parameter values are obtained using the
phpMyAdmin warning:require_once (./libraries/common.lib.php) Error resolution
Sometimes when the phpMyAdmin is installed, the following is the case when you visit in IE:
Warning:require_once (./libraries/common.lib.php): Failed to open stream:no
If you want to handle Java interface. This is how it behaves in PHP:
The following is a JSON string that has been processed to return to JavaScript. You just need to put the address of the controller in the form of a URL to the docking personnel
Iecapt can capture Web pages, generate images in BMP, JPEG, or PNG format, including C + + and C # Two versions, not dependent on Internet Explorer, which determines that it can only be used under Windows. Iecapt is a command-line tool that uses the
Recently from Google Ananlytics found that the Web site slowed a lot, so think of PHP fpm slow log function.
Fortunately, the PHP-FPM provides a slow execution log, which dumps the call procedure that executes the slower script into the log.
Shell
Function:
1. Get the url,email,image in the content.
2. Replace the url,email,image in the content.
Url:xxx
Email:admin@admin.com
Image:
Grep.class.php
'/ '/([\w\-\.] +@[\w\-\.] + (\.\w+))/', ' image ' => '//i"); Private $_content = ';
INI settings
Like the super global variables and persistent constants you see in the previous chapter, the php.ini value must be defined in the extended Minit code block. However, unlike other features, the INI option is defined only by a simple
Let's look at some basic concepts first.
One, PHP script and dynamic page.
PHP script is a server-side scripting, can be embedded and other methods and HTML files mixed, but also class, function encapsulation, such as the form of templates to the
For years, the goal of creating truly responsive Web applications has been hampered by a simple fact of web development: To change the information on one part of a page, users must overload the entire page. But it won't happen again. Thanks for
In the evening to help friends look at the problem of IIS, conveniently recorded.
Site Directory is e:\mysite\www.**.com, is the DISCUZ program, hint:
Warning:require_once (./include/common.inc.php) [Function.require-once]: failed to open
Server
ServerSet error handlingError_reporting (E_all);Set run timeSet_time_limit (0);BufferingOb_implicit_flush ();$ip = "127.0.0.1"; IP Address$port = 1000; Port number$socket = Socket_create (Af_inet, Sock_stream, sol_tcp); Create a SOCKETif
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