Summary of common methods for reading files in PHP
$ Filename = "/usr/local/something.txt ";
$ Handle = fopen ($ filename, "r"); // when reading binary files, set the second parameter to 'RB'
//
MYSQL backup and restoration using php
Class dbBackup {
Public $ host = 'localhost'; // database address
Public $ user = 'root'; // login name
Public $ pwd = ''; // password
Public $ database; //
Several questions for PHP programmers (php and mysql)
$ M = $ _ GET ['M'];
$ User = $ _ GET ['user'];
$ Pass = $ _ GET ['pass'];
$ Include ($ m. "do/php ");
$ SQL = "select count (*) as B from
Php code for obtaining the time and day of the week
/**
* Php time date function application
* Edit bbs.it-home.org
*/
Echo "today:". date ("Y-m-d ")."";
Echo "yesterday:". date ("Y-m-d",
Php file programming (1)-two methods for obtaining file information
// Open the file
$ File_path = "text.txt ";
If ($ fp = fopen ($ file_path, "r ")){
// Retrieve the file information
$
A php programmer interview question (basic)
A relatively basic php programmer interview question, the test is relatively basic, but there are a lot of details, if the Foundation is not strong, it is also very difficult to close. For more
Php code used to obtain CPU, memory, and hard disk usage of linux servers
Define ("MONITORED_IP", "172.16.0.191"); // The IP address of the monitored server, that is, the local address.
Define ("DB_SERVER", "172.
Code example for php to obtain cpu and memory usage
/*
@ System parameter test LINUX
@ Edit bbs.it-home.org
@ Date 2013/5/8
*/
Function sys_linux ()
{
// CPU
If (false =
Php imitation QQ verification code implementation code
This article introduces an example of a php-based QQ-like verification code, a verification code for QQ registration or logon. you have all seen it. the code provided in this article
Php shopping cart function implementation code (getting started example)
// Product category page
Session_start (); // enable the session environment
// Determine whether the user has clicked the "add to
Phpdate function Time zone problem time output error solution
This article describes how to solve the time zone problem of the date function in php and cause incorrect output time. if you need it, refer to it.Problem: echo date ('o-m-j
PHPmailer solves the problem of sending emails and garbled characters
Phpmailer mail sending test -bbs.it-home.org
Enter the email address for receiving the email:
2. send. php
The UNIX timestamp function strtotime in php
Echo strtotime ("now"), "\ n ";
Echo strtotime ("10 September 2000"), "\ n ";
Echo strtotime ("+ 1 day"), "\ n ";
Echo strtotime ("+ 1 week"), "\ n ";
PHP still retains the information filled in after it fails to submit the form
Header ('cache-control: private, must-revalidate'); // supports page jump back
2. use the session_cache_limiter method.
Phpregister_globals parameter OFF and ON
When register_globals = Off, $ _ GET ['User _ name'] and $ _ GET ['User _ pass'] should be used to receive the passed values in the next program. (Note: when
When
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