Introduce a function that you wrote first.
Copy Code code as follows:
$IMGSRC = "Yun_qi_img/dontlinkme.png";
$width = 780;
$height = 420;
Resizejpg ($IMGSRC, $IMGDST, $width, $height);
function Resizejpg ($IMGSRC, $IMGDST,
This method can also be used to determine whether the separator symbol is available. For example:
Copy Code code as follows:
if ($_module[tg1_tjly]) {
$TG 1_tjly = explode ("|", $_module[tg1_tjly]);
if (count ($tg 1_tjly) >1) {//Emphasis
Copy Code code as follows:
/**
* Bubble Sort Bubble sort
*
* Principle: Multiple loops to compare, each time the maximum number of comparisons to move to the top. Each time you loop, find the maximum value in the remaining variable, and then
Copy Code code as follows:
Gets the directory name of the specified folder
function Get_dir_name ($dir _path, $file)
{
$dirpath = $dir _path;
$dir = Scandir ($dirpath);
foreach ($dir as $key => $value)
{
if (Is_dir ($dirpath. ') /'.
This article illustrates how PHP implements the Gzip configuration method in the Apache environment. Share to everyone for your reference. Specifically as follows:
1, conf/httpd.conf
1) Remove the #loadmodule headers_module modules/mod_headers.so
This article describes the PHP Micro-trust public platform development class. Share to everyone for your reference. The specific analysis is as follows:
The thinkwechat.php class files are as follows:
auth ($token) | |
Exit
if (!empty (
On the front page of the page, add
Date_default_timezone_set (PRC); /* To transfer time to Beijing time, PHP5 defaults to Greenwich Standard TIME * *
Date ()
A: "AM" or "PM"
A: "AM" or "PM"
D: A few days, two digits, if not enough to fill 0; from "01
config = $config; }//FTP connection Public function connect () {return $this->conn = ftp_connect ($this->config[' host '), $this->confi
g[' Port ']); ///Transport Data Transfer layer protocol, obtaining the true or false public function download ($
Tclip is used for image cropping with the following characteristics:
Can carry on face recognition. There are faces in the picture that will automatically be considered as an important area of the face area and will not be cropped out.Automatically
You can use In_array () to return TRUE or False if you have a large array and you want to do only to find a given value that exists. The following code outputs the not found in this array because you will be looking for a "alber" that does not exist
Sapi:server application Programming Interface Service-side application programming port. He is the interface that PHP interacts with other applications, and PHP scripts can be executed in many ways, either through a Web server or directly on the
To read and write files in PHP, you can use the built-in functions:
1.fopen (create file and open file)
Grammar:
Copy Code code as follows:
fopen (Filename,mode)
filename, specify the file to open. mode, open the pattern of the
Solution:
Using PHP to resolve
Use the File_get_contents function, but the pros and cons if the URL is not accessible, a terminating program problem occurs
Use curl to return, and then determine if the correct execution
Use the Get_headers function
This example describes how PHP obtains header information that is sent to the user. Share to everyone for your reference. The specific analysis is as follows:
The Headers_list function has no arguments and returns an array. The returned array
One, the Chinese character to decimal principle analysis
In GBK encoding, a Chinese character is composed of two characters, and the method to get the character string is as follows
Copy Code code as follows:
$string = "Don't be
Chr function is used to convert ASCII code to characters
The ORD function is used to convert characters to ASCII code
ASCII code is the computer can display the character of the code, its value range is 0-255, including punctuation, letters,
First, Chinese interception: Mb_substr ()
Mb_substr ($str, $start, $length, $encoding)
$str, a string that needs to be truncated
$start, starting at 0 at the beginning of the truncation
$length, the number of words to intercept
$encoding, page
usually with Number_format (); To format numbers, the default thousand are separated by commas, such as:
Copy Code code as follows:
Echo Number_format ("10000.01231", 2);
2 digits after the decimal point, the output result is: 10,000.1000
This example describes how PHP uses Array_fill to define multidimensional arrays. Share to everyone for your reference. The specific analysis is as follows:
PHP can be nested with multiple array_fill to complete the definition of multidimensional
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