Sometimes we need to add external links, but it is not good for a website to have too many external links, so we can achieve this through navigation. URL jump code
1. Code:
For example, if you save it as aaa. php, you can implement aaa. php? Url
Websites often need to query the website's whois information. here we will introduce a whoisapi interface created using php. the method is also very simple. The following describes in detail. Here we get data from the data interface of HiChina or
A piece of code found online! Then I wrote another piece of code based on phpDOMDocument. For more information, see. Below is the online
Copy codeThe code is as follows:
Class ArrayToXML
{
/**
* The main function for converting to an XML document.
*
For more information about PHP, see.
I. PHP script code markPHP scripts are the content of a pair of special tags in the file. for example, ASP is "", and PHP can be viewed as"
".
However, to adapt to XML standards to embed PHP into XML or XHTML,
For a long time, writing php uses Dreamweaver. sometimes it is really painful. if you have a bug and want to see the values of some elements, you must use echo output to know, now I have learned a powerful breakpoint debugging tool, and php can
Php getting started Knowledge Point 7: basic application of PHP functions, which are very common. you can take a look.
Copy codeThe code is as follows:
/*
* Simple functions
*/
Function fontBold ($ con ){
Return"
$ Con";
}
$ Str = "simple function
Today, a customer's server is frequently written with a backdoor and deleted. the following code was added to the program. you can pay attention to the parameters of the base64_decode function. Today, a customer's server is frequently written:
Mm.
This section briefly introduces some basic programming points. compared with system security, php Security defense requires programmers to be more careful with the various parameters entered by users. PHP code security and XSS, SQL injection, and so
PHPRPC is a lightweight, secure, cross-Internet, cross-language, cross-platform, cross-environment, cross-domain, support for transmission of complex objects, support for parameter reference, and support content output redirection, hierarchical
The end () function points the internal pointer of the array to the last element and returns the value (if successful) of the element ). Definition and usage
The end () function points the internal pointer of the array to the last element and
The array_combine () function combines two arrays to create a new array. one of the arrays is the key name, and the other array is the key value.
Array_combine () definition and usageThe array_combine () function combines two arrays to create a new
The in_array () function searches the array for the specified value in_array (). definition and usage
The in_array () function searches for the given value in the array.
Syntax
In_array (value, array, type)
Parameter description
Value is required.
The array_unique () function removes repeated values from the array and returns the result array. When the values of several array elements are equal, only the first element is retained, and other elements are deleted.
Array_unique () definition
The browser and server communicate with each other over the connectionless HTTP protocol. connectionless programs are characterized by client requests to the server. the server outputs the corresponding program according to the request, if the
What are CGI, FastCGI, PHP-CGI, PHP-FPM, and Spawn-FCGI? In the php runtime environment configuration, which one is more suitable for websites.
What is CGI?
CGI is a Common Gateway Interface. it is a tool for the HTTP server to "talk" with programs
In PHP, you can easily use the following statement to disable page caching, but it is difficult to remember it for your convenience. Core code:
Copy codeThe code is as follows:
Header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT ");
Header
Php uses curl to determine whether a remote file exists. some of our programs need to determine whether the file exists before performing subsequent operations.
Copy codeThe code is as follows:
// Determine the remote file
Function check_remote_file_
Determine whether a url can be accessed normally. avoid the use of file_get_contents because the url cannot be accessed, resulting in a fatal error and program termination problems.
Copy codeThe code is as follows:
$ Url = 'http: // www.baidu.com '
When we post on a forum, post a comment, or use a QQ space to publish a log or Weibo post a comment, the published content is displayed as "just", "5 minutes ago", and "Yesterday, instead of displaying the specific date and time directly. This
Some functions of the mysql module in php are simply encapsulated. many cms packages some mysql operation code classes. for details, refer.
Copy codeThe code is as follows:
Class mysql
{
Private $ db; // datebase connect
Private $ result; // mysql
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