Use PHP GD, use good, one key to cut various sizes, pack and download. Always change the icon to understand, art to give you a 1024 logo, you have to PS a variety of sizes, so have this thing.
Core code
Copy Code code as follows:
Class
In PHP, we all know that there are special MB_SUBSTR and Mb_strlen functions that can intercept and compute the length of Chinese, but because these functions are not PHP's core functions, they are often not open. Of course, if you are using your
Recently want to use PHP to write a crawler, you need to parse the HTML, on the SourceForge to find a project called PHP simple HTML DOM Parser, it can be in a similar way jquery through the CSS selector to return the specified DOM elements, the
Commonly used time functions:
1.time (); The total number of seconds from 1970/1/1 00:00:00 to today
2.mktime (); Set time
3.date (); More information on getting time
represents a String
Description
Example
Output
Copy Code code as follows:
/**
* Friendly Date Time
*
* @param datetime $datetime Date Time
* @param int $size precise in place number
* @throws \invalidargumentexception
* @return String
*/
function Friendly_date ($datetime, $size =1)
Array_push () Definition and usage
The Array_push () function adds one or more elements (into the stack) to the end of the array of the first argument, and then returns the length of the new array.
This function equals multiple calls to the $array [
To remove an array element by the specified element value
Copy Code code as follows:
Remove elements with a value of "Cat"
$a =array ("a" => "Dog", "B" => "Cat", "C" => "horse");
Print_r ($a);
unset ($a [Array_search ("Cat",
Ihipop School of Discuz X1.5 Forum was black, where a quarrel for an afternoon. Google "discuz! x1-1.5 notify_credit.php blind SQL injection exploit ", you know.
Discuz is a very popular forum system in China, it should be a lot of black sites. But
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 uses Strtotime to calculate the number of days between two given dates. Share to everyone for your reference. The specific analysis is as follows:
The Strtotime function of PHP is used to resolve the date-time
This article describes the PHP ban on an IP or IP address section of the method of access to share for everyone to reference. The specific analysis is as follows:
Because I haven't studied Apache and Nginx, I've written a small program that can
The examples in this article summarize the common methods used to obtain file name suffixes in PHP. Share to everyone for your reference. The implementation methods are as follows:
";
The second method
, Echo End ($pics). ";
End () method,
PHP uses the array as a stack, mainly using Array_push () and Array_pop () two system functions to complete. The stack mainly uses the Array_push () function to add one or more elements to the tail of the first parameter, and then returns the length
One, no matter what the program, function name () {}, for () {}, .... Too much, do not say also know what to do with.
Two, $str {4} After the string's variable followed by {} braces and brackets are all treating a string variable as an array.
Three,
These days write PHP program, feel a lot of places than asp,asp.net,jsp conveniently, such as session use first get Session_Start (), file jump header use is also inconvenient ....
Maybe not familiar with some of the features of PHP, but write more,
This article is an example of the implementation of PHP image local mosaic method. Share to everyone for your reference. The specific analysis is as follows:
Principle:
Adds a number of widths and heights to each pixel in the selected area of the
1. User access to the server, the use of PHP's super global variable $_server in the Array field [' Http_user_agent '] to get access to all the user information
$_server[' http_user_agent ' string when I visit:
mozilla/5.0 (Windows; U Windows NT 6.
Simple Factory mode:
① abstract base class: class definition abstract Some methods to implement in subclasses
② inherits from the abstract base class: Implementing an abstract method in a base class
③ Factory class: Used to instantiate objects
Read
This article illustrates the method of solving the Chinese garbled problem by the Imagettftext function of GD library in PHP. Share to everyone for your reference. Specifically as follows:
When using Imagettftext to write Chinese, garbled problems
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