A The first is the PHP page encoding1. The encoding of the PHP file itself should match the encoding of the Web page
A. If you want to use gb2312 encoding, then PHP will output headers: header ("content-type:text/html; Charset=gb2312″), static page
1. Appservnetwork
First, let's download some PHP-related stuff first.
First, let's download a complete set of PHP-related tool--appservnetwork.
Appserv 2.5.10 PHP Operating environmentAppserv 2.6.0 PHP Operating environmentAfter the installation is
A simple example is calculating the number of days to borrow, which requires PHP to calculate on a daily basis, and here are a few ways to implement this date calculation:
(1) It's easy if you have a database! If MSSQL can use a trigger! Use a
$curDomain = $_server[' http_host ');
$strHTML = file_get_contents (' http://www.jb51.net/DomainParking.asp?gDomName= '. $curDomain);
Echo $strHTML
?>
Long ago on the internet to see that file_get_contents is not stable, indeed met ...
On the other
1. Connect MySQL Database code
$connec =mysql_connect ("localhost", "root", "root") or Die ("Cannot connect to database server:". mysql_error ());
mysql_select_db ("Liuyanben", $connec) or Die ("Cannot select Database:". mysql_error
Because this is a language problem, conventional solutions are more difficult to solve. The following is a scenario that is solved by string.
Copy CodeThe code is as follows:
$total = 100000;
$double = "";
for ($i = 0; $i {
$double. = Pack ("D", $i
Baidu consulted some of the information, combined with some of their own experience, the following solutions:
Copy CodeThe code is as follows:
$idlist = ";
for ($i =1; $i if ($i ==1) {
$idlist =mt_rand (3,25216);
}
else{
$idlist = $idlist. ', '. Mt_
Copy CodeThe code is as follows:
Class timer//page Execution time classes
{
var starttime;//page Start Execution time
var stoptime;//page End Execution time
Var spendtime;//time spent on page execution
function Getmicrotime ()//Gets the
Run the program after installation is complete
Register with the Register option in the Help menu.
The registration code is provided as follows:
Username:zendstudio.netSerial number:3727234f6095f72034f6095f
Description
string fread (int handle, int length)
Fread () reads up to length bytes from a file pointer handle. The function stops reading the file when it has read up to the maximum length of bytes, or when it reaches EOF, or (for a network stream)
Annotation symbols:
Single-line annotations/* * * Multi-line annotations
Use of quotation marks
' Single quotation marks, without any meaning, are brought directly over by any treatment;"" Double quotes, PHP
Copy CodeThe code is as follows:
$memcached = Array (//multi-process simulation with memcached multiple memcached server cn en as Memory server name
' CN ' =>array (' 192.168.254.144 ', 11211),
' En ' =>array (' 192.168.254.144 ', 11212)
);
$mysql =
First, PHP gets the URL of the current page:
Copy CodeThe code is as follows:
Get the current script URL
function Getcururl ()
{
if (!empty ($_server["Request_uri"))
{
$scriptName = $_server["Request_uri"];
$nowurl =
Copy CodeThe code is as follows:
/*
* Class:mssql
* TIME:2009-12-10
* Author:libaochang
* version:1.0b
* Description:mssql Database access Class,it can execute the Procedur or SQL
*/
Class Mssqlutil
{
var $user = null; Database user Name
var $keys =
Are downloading the latest recommended version, originally did not expect to send to the jar, so did not, later summed up to Notepad when found there are quite a lot of problems, so share out, I hope to everyone
Helpful. In doing the experiment, I
DOMDocument related content.
Property:
Attributes a list of properties for a storage node (read-only)
ChildNodes List of child nodes of the storage node (read-only)
DataType returns the data type of this node
Definition of a node defined in a DTD
Description
BOOL File_exists (String $filename)
Returns TRUE if the file or directory specified by filename is present, otherwise FALSE.
In fact, PHP tutorial file_exists function and file_exists syntax we've already talked about it, let's take a
Merging arrays has three functions:
1.array_combine ()
carries two parameter array, the value of the parameter array one as the key of the new array, and the value of the parameter array two as the value of the new array. Very simple.
Example:
Copy CodeThe code is as follows:
/* --------------------------------
System:pt book-pt novel Thief
Code: Jay Less Pakey
----------------------------------- */
$pt _mysql = new Dbquery;
/**
* MySQL Query class
*
*/
Class Dbquery {
/**
* Total
Here is the corresponding code:
PHP Code:
Copy CodeThe code is as follows:
Set some basic variables
$host = "192.168.1.99";
$port = 1234;
Setting the time-out period
Set_time_limit (0);
Create a socket
$socket = Socket_create (af_inet, sock_stream,
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