In PHP, the file operation is relatively simple, the first is the file open, in PHP Open file will use the fopen function, the basic usage is:
fopen(string $filename, String $mode) $filename is the file name, $mode is the open method. The specific
In the following example, we'll create a simple file upload utility. This utility is composed of two Parts:one Flash file that'll access the file system and grab the file and one PHP Page that'll do the work of uploading said file.
This is a excerpt
One of the major issues to be concerned with in database usage is access rights, the exposure of user names and passwords. In the programming for the convenience, generally will use a db.inc file to save, for example:
User names and passwords are
I did a test today and wrote File_put_contents (' Log.txt ', "log info ') in any controller \ model\ common/function.php in the thinkphp project.
The last generated log.txt is actually in the project root directory.
No wonder the thinkphp Address
* * one. Server-side Set header header allows Ajax to cross domain
**The code is as follows:
Allows the cross domain request
header ("Access-control-allow-origin:ityangs.net") initiated by Ityangs.net;
If you need to set up Cross-domain requests
Function: __autoload () future will be discarded (spl_autoload_register () substitution)
Function: When the class name error, the __autoload () use reason: When writing code will refer to a lot of require or include, this will cause code confusion
Origin:http://www.tuicool.com/articles/ir2aree
Nginx ("Engine X") is a high-performance HTTP and reverse proxy server and a IMAP/POP3/SMTP proxy server. Nginx was developed by Igor Sysoev, the second rambler.ru site for Russian visits, and the
simple additions and deletions to change the search
1 increase
$table->insert ($data);
$data is deleted as an array
2
$table->remove ($where)
$where Array condition
3 modified
$row = $table->findone ($where);
$where an array
of conditions $
In PHP development work is very much used to timeout processing to the occasion, I say a few scenarios: get the data asynchronously if a backend data source gets unsuccessful, it skips and does not affect the entire page presentation in order to
Install configuration php-fpm to build a nginx+php production environment
Nginx itself can not handle PHP, it is just a Web server, when the request is received, if it is a PHP request, then sent to the PHP interpreter processing, and the results
This article mainly introduces 53 details of PHP code optimization, common and important PHP optimization strategy, the need for friends can refer to the use of single quotes instead of double quotes to contain strings, this will be faster. Because
Read File contents
$file _headle = fopen ("./text.txt", ' r ');//If the read file does not exist, it will be an error
$read = Fread ($file _headle, 2);
Echo $read;
?>
Writing file contents$file _headle = fopen ("./text.txt", ' w ');//If the file
Author: zccst
Installed extensions include: SOAP, pdo_mysql, curl, etc.
1, install Curl
Cd/lamp/php-5.2.6/ext/curl
#/usr/local/php/bin/phpize#./configure--with-php-config=/usr/local/php/bin/php-config# make# make InstallHere you will be prompted
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