Especially like to know which spiders to visit the site, the frequency of visits, pages, ordinary site statistics are not resolved.
Although I know a little about PHP, but by virtue of. NET development experience, with the help of Baidu is still
Use of Linux Systems
Now standard system is Linux + Nginx + PHP + MySQL, so the configuration of more and more large companies in the use of the configuration is different is a company's statute, for example, the mount is generally divided into 2
Is the mind map for this series of functions--and I'm also the first to use a mind mapping tool. The big picture is here. The Stream_socket_* series is a new addition to the PHP 5 processing socket connection functions, simple and convenient, next
Copy CodeThe code is as follows:
Description: Get a generic solution for _server[' Request_uri ' values
function Request_uri ()
{
if (Isset ($_server[' Request_uri '))
{
$uri = $_server[' Request_uri ');
}
Else
{
if (Isset ($_server[' argv
Copy the code, save as cs.php, to save it as a different name, notice the change
Actual address: "target=" >
"_blank"
Thunderbolt chain: "target=" _blank ">
Express Chain: "target=" >
"_blank"
Cyclone chain: "target=" >
"_blank"
Copy CodeThe code is as follows:
#*******************************************
#作用: Page no action, auto expiration function
#参数: $onlinetime The last time the current page was used
#参数: $interval page Time-out
#返回: None
#****************************
The contents of the sql.php file are as follows:
Copy the Code code as follows:
System ("Mysql-uroot-pmypassword Database print "SQL OK";
?>
Where root represents the database user name, MyPassword represents the root password, database
Due to the PHP language itself does not support multi-threading, so the development of crawler efficiency is not high, this time often need to use Curl Multi Functions It can achieve concurrent multi-threaded access to multiple URL addresses. Since
Copy CodeThe code is as follows:
/* Get Picture News list */
function Getpicnews ($number =5) {
Require_once ' include/content_class.php ';
$Content =new Content ();
$sql = ' Select ContentID as Id,title,pic,typeid from ' cms_content ' where pic<> ',
If you want to use the PHP drawing function, first of all to enable the function of this module. Just remove the php_gd2.dll in front of the php.ini.
Start drawing below:
Copy CodeThe code is as follows:
Session_Start ();
Generate a Captcha
Copy CodeThe code is as follows:
Poll results
User comments are as follows:
Copy CodeThe code is as follows:
$link = mysql_connect (' localhost ', ' root ', ') or Die (Mysql_error ());
mysql_select_db (' vote ', $
In TP, we can use the following two ways to create a data table mapping object (I used temporarily)
First type: $Test = D (' Test ')
Second type: $Test = new Model (' Test ')
Although both of these can be select,insert,delete,udpate operations on
Copy CodeThe code is as follows:
– Delete multiple static pages generated from an article
– the generated article is named 5.html 5_2.html 5_3.html
/*—————————————————— */
function delstatichtml ($article _id)
{
Global $db;
$sql = "Select '
The topic of the PHP interview question:
$a = '/a/b/c/d/e.php '; $b = '/a/b/12/34/c.php '; Calculate $b relative path relative to $a should be: /.. /c/d
Answers to the PHP interview questions:
Copy CodeThe code is as follows:
function getrelative (
One: Set cookies
Cookies must be set before using cookies.
function prototypes: int Setcookie (string name,string value,int expire,string path,string domain,int Secure)
All parameters, except name, are optional and can be represented by an empty
PHP Face question Description:
Example: My name is Fanglor = "ym Eman si Orlgnaf
Answers to the PHP interview questions:
Copy CodeThe code is as follows:
function Restr ($STR)
{
$str 1 = Explode ("', $str);
$str 2 = ";
$temp = ";
for ($i =0; $i
1.Memcache Related Introduction
Memcache is a high-performance distributed memory object caching system that can be used to store data in a variety of formats, including images, videos, files, and database retrieval results.
The use of Memcache
If the workload is too large to use the SQL statement, then try to write a cross-table class, so apart, let's look at the code
Copy CodeThe code is as follows:
/**
* Basic cross-table
* @author Hugh
*
*/
Class Pivot
{
Private $HORIZONTAL
1. Before using Google API, we need to apply for a key, which is appended to the URL as a unique indicator.
2. Google Maps API has an address where you can find detailed information about a location, for example, in Beijing:
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