Introduction to PHP
With the rapid development of network technology, the scripting language of creating dynamic Web sites based on server is endless. PHP, with its simplicity, ease of use, portability and so on, in many dynamic Web site language
1. In PHP, the name of the current script (excluding the path and query string) is recorded in a predefined variable (1), while the URL linked to the current page is recorded in a predefined variable (2).
Copy Code code as follows:
To test the page code:
Copy Code code as follows:
php gets the line-wrapping problem in the form area data
$content =empty ($_post[' content ')? Null:trim ($_post[' content '));
if (!empty ($content)) echo str_replace ("\
As a PHP programmer, especially novice, for the Internet sinister always know too little, for the outside of the intrusion there are many times the hands are no way, they do not know how the hacker intrusion, submit intrusion, upload vulnerabilities,
Example of PHP error triggered by Trigger_error in PHP
"Error suppressor @"
In addition to the error_reporting and display_errors settings in PHP.ini, the error_reporting () function, the Ini_set () function, you can also use the error suppressor @
PS: This code in the win system run no problem, the Maple Pro test available. If you are using Linux or other systems, you need to test yourself.
$filename = "./". $_request[' name '];
This is the specific path of maple, as long as the
1. __construct () and __destruct ()
Invoked when an instance is created/destroyed, you can pass 0 or more parameters.
Class A
{
function A ()
{
echo "build A";
}
function __destruct ()
{
echo "destroy A";
}
}
$obj =
Method 1: Get the content with file_get_contents:
Method 2: Open the URL with fopen to get the content:
Method 3: Use the file_get_contents function to get the URL by post
' Bar ');
$data = Http_build_query
Demand:1, after the execution of the script, the students want to enter the English name of the whole spell, generating a random number of 01-99 between the number,The larger the number to participate in the project practice, the number that has
It just needs to be converted two times. Most of the time, we are on the character set conversion time will be so, such as judging the parameters passed in whether Utf-8, the 5 characters of the writing, but more, such as utf-8,utf-8,utf-8, then how
This article describes the PHP based on Phpqrcode generation with logo image of two-dimensional code. Share to everyone for your reference. Specifically as follows:
Here PHP uses Phpqrcode to generate a logo image of the two-dimensional code, easy
The example in this article describes PHP's approach to parsing Web page HTML based on Snoopy. Share to everyone for your reference. The implementation method is as follows:
Set_time_limit (0);
$user = Array (' 20517 ', ' 20518 '); Header
This example describes the simple minesweeper game that PHP implements. Share to everyone for your reference. as follows:
= 0 && $j-1 >= 0 && $data ["Data". ( $i-1). " _". ($j-1)] = $cnt ++;//upper Left if ($i-1 >= 0 && $data ["Data". ( $i-1).
For advanced versions such as PHP5.5, this article requires the addition of--enable-opcache parameters at compile time
After compiling the installation, we begin to configure the Opcache
Copy Code code as follows:
[Opcache]
Zend_extension
Mysql.class.php file See http://www.jb51.net/article/25496.htm
Copy Code code as follows:
Include MySQL operations class
Include_once ' Mysql.class.php ';
Local MySQL Data
$mysql _local_data = Array (' db_host ' => ' localhost '),
'
Recently read a book, which mentions some hash algorithm. More impressive is Times33, at that time understanding is not very penetrating test, today wrote a section of the program to verify a bit.First code:
Copy Code code as follows:
/
Copy Code code as follows:
echo Mktime (11,25,0,9,5,2010);
Echo Microtime ();
echo Mktime (0,0,0,1,1,1970);
?>
This output is 1283657290, 1283657100, 0.88533200 1283657290, and-25200 respectively. From the last value, we know
The example in this article describes how PHP uses the Mail class library with pear to send mail. Share to everyone for your reference. Specifically as follows:
Here, you can use Pear's own mail class library to send mail, and the Pear Install
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