This article by the Code Rural Network original translation, reproduced please see the text at the end of the reprint requirements, thank you for your cooperation!
Brief introduction
I have a Web site written in PHP, similar to a personal testing
It's okay when you encapsulate a socket class
The function is simple and the curl function is the same
Class socketclass{private $host; Private $url; Private $error _no = 0; Public $error _str = "; Private $port = 80; Private
transferred from: http://blog.csdn.net/a600423444/article/details/12720543
Objective
The essential part of development is debugging, and the way of debugging directly affects the development efficiency and software quality.
Prior to the development
This article mainly describes the PHP capture fatal error Error method, using Register_shutdown_function to catch fatal error errors, the need for friends can refer to the following
Fatal error generally does not need to be captured, but in a
in PHP, arrays are divided into two categories: numeric indexed arrays and associative arrays.
where the numeric index array is the same as the array in the C language, the subscript is for 0,1,2 ...
associative array subscripts may be of any
There are three scenarios for copying objects:
1, direct copy $a = $b
This is a shallow copy, and $b changes when you change $ A, because they point to the same heap area.
2,clone copy $a = Clone $b
This copy looks like a deep copy, and when $ A
"Database Operations Model models"
Model Database Operations
TP Framework Main design pattern: MVC
C:controller Controller shop/lib/action/Specific controller
V:view view shop/tpl/grouping/template files
M:model Data Model shop/lib/model/Concrete
Polling: The client periodically sends an AJAX request to the server, returning the response information and closing the connection as soon as the server receives the request.
Pros: It's easier to write back-end programs.
Cons: Half of the
Constants: Use const (PHP5) Declaration, can only be assigned once, PHP5 the following versions use define;
1
PHP2const the_value = 100; // only const in PHP5 3 Echo The_value; 4 5 Define (' The_value ', 200); // older versions below PHP5
1. Title: implement a queue with two stacks . First with a stack input data, and then output this stack to another stack, you can form a queue of FIFO order.
Because the PHP array can emulate the implementation of the stack, the code is as
1. Read more manuals and source code
There's nothing more to emphasize than reading a manual – You can learn a lot of things just by reading a manual, especially a lot of functions that have a string and an array. There are many useful
The ultimate goal of pure static PHP implementation is to generate a pure HTML file, and this pure HTML file is stored in the server's disk;
PHP implementation of the page purely static needs things:
1. File Write function
File_put_contents (),
SHOPNC B2B2C to open pseudo-static method
A. Windows environment
1. First download the ISAPI rewrite plugin, install, and then we change the root directory below htaccess.txt so that the. htaccess can be.2. Locate the Site Directory \data\config
Upload a picture file and display a picture on the page
Enctype Description: The Enctype property specifies the type of encoding the browser uses when sending data back to the server.
Value Description:
multipart/form-data: The form data is encoded
/* * This program is to take a random number of different elements from a non-repeating array * The difficulty is to prevent the occurrence of the number of times that have already been taken (especially to the last), need to reduce the collision *//
Yesterday to cool dog interview, in the written test that a pass, Youdao requires PHP to achieve bubble sorting programming problem, because it is too long used bubble sort, forget the principle of the algorithm, the result left blank, really no
Single-piece mode is easier to implement in PHP5, and PHP5 's access control for class-internal variables and functions is enhanced. The Dbconn::_construct () construction method is set to private, and the class cannot be instantiated directly.
The
Nginx under the alias seems to be only for the static file service, for fastcgi such as PHP will always appear error, typical is 404.
In this respect, there have been some solutions on the Internet, such as:
http://u.odo.com.cn/space-2-do-blog-id-3
When installing DEDECMS, notice that the system requires two functions, so by the way, look at the definitions of the two functions:
Allow_url_fopen
is to allow a function such as fopen to open the URL.
Here's a more official
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