This article introduces a PHP implementation of a thumbnail class, support loading picture file and loading picture string, proportional stretching, etc., the code is followed by a call example for reference.Share a PHP thumbnail class, you can
This article introduces, using PHP to read pictures, and output to the browser to display a piece of code, there is a need for friends reference.In PHP, if PHP with pictures, Zip,exe, and other files output to the browser, and the front also output
This article introduces, PHP implementation of the file download encountered some problems and solutions, there is a need for friends to reference.When using PHP to download the file, pop-up browser comes with the download box, the Save As action
This article introduces, with PHP implementation of the query Baidu included, Google included the situation of a piece of code, there is a need for friends reference.Use PHP to query Baidu or Google's inclusion situation, in fact, is not complex,
/**
* Define and use PHP abstract classes
* edit:bbs.it-home.org
*/
Abstract class Number {
Private $value;
Abstract public Function value ();
Public Function Reset () {
$this->value = NULL;
}
Share two constructors for a tree array without recursive implementations, and have a friend to make a reference.Non-recursive tree array constructors, code:
$item) {if ($item [$pid]) {if (! isset ($t [$item [$pid]] [' Parent '] [$item [$pid]])
if ($something) {
Include ("Somefile");
}
Copy CodeExample 2, but regardless of the value of $something, the file somefile will be included in the file:
if ($something) {
Require ("Somefile");
This article introduces a simple example of PHP implementation of cloud tags, written by foreigners, is very simple refining. If you need a friend, you can refer to someone else's wording.PHP Cloud Tag example, the code is as follows:
$value) {/
Get the current domain name:
echo $_server[' server_name '];//get the source URL, that is, click to the previous page of this page URL
echo "";
echo $_server["Http_referer"]; Gets the suffix of the previous page domain name
This article introduces the following, a section can get search engine inbound keyword code, there is a need for friends reference.The code is as follows:
0) {$start =stripos ($url, ' & '); $s _s_keyword=substr ($url, 0, $start); } else {$s
This article describes a piece of code that creates a tag cloud with PHP, creating a tag cloud effect from a custom PHP function. Refer to a friend who needs it.An example of creating code for the PHP tag cloud is as follows: $count) {$size =
This article introduces, in PHP based on the time stamp obtained one months of the first day of implementation code, interested friends, you can study oh.This function is given in this section to get the first day of the month. The function accepts
$a =array (1,4,5);
$b = $a;//The array is not copied
$a [1]=10;//array copied, and the value has been modified
Print_r ($a);
Print_r ($b);
?>
Copy CodeThe value of $ A and $b is not the same
This article introduces, PHP implementation of a mail sending class, based on text template to send mail, very good, have the need for friends to refer to the next bar.A PHP email send class, you can construct a simple message format, the effect is
!--? php
require ("config.php");
require_once ' tags.php ';
$sql = "Select tags from demo";//Here you can randomly or limit the number of extracts.
$rs = $db->query ($sql);
while ($tags =
This article collects some PHP in the stream data flow of the function set, the need for friends, you can refer to the next.A set of PHP stream functions, as follows:Stream_bucket_append function: Add data to the queue Stream_bucket_make_writeable
Print ""; The cache file is usually read
?>
Print ""; Added a unique number to make the browser request again
W//print "";
?>
Copy Code2, custom PHP function, send the picture to the browser
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