PHP image upload class attached to call method,
This example for everyone to share the PHP image upload class, for your reference, the specific content as follows
Call Method:
get_ph_tmpname ($_files[' photo ' [' tmp_name ']), $up->get_ph_type
have been doing PHP development work. In the process of development has long been heard "pseudo-static" this said. But it has never been understood.
Today finally decided to have a good understanding of the content of this aspect.
First, what is
The first step. First of all use the regular to pull out from the article.
Copy CodeThe code is as follows:
$message//article content
Regular (this is not yet)
$reg = "/]*src=\" (http:\/\/(. +) \ (. +) \. ( JPG|GIF|BMP|BNP)) \ "/isu";
Store the
1. 10 sentences 1. do not attach the register_globalON environment. from the day when you first learned how to configure the php runtime environment and even do not understand the impact of register_global ON/off on yourself, we should set it to OFF.
(1) the first two functions of echo, print, printf, and sprintf are output strings. if there is a variable name in the string, it is converted to its value. the last two functions are similar to C functions with the same name. (2) strchr, strlen,
php--the function of the following class is very powerful, not only can send HTML-formatted mail, you can also send attachments
How to use:
Copy CodeThe code is as follows:
Include "Email.class"
$mail->setto ("a@a.com"); Recipient
$mail-SETCC
Grammar
String strings can be defined in three ways
"(single quote)" "(double quotation mark)
The escape sequence can be interpreted as \ \ \
The biggest feature of double quotes is that variable names are replaced by variable values
Delimiter
1. When you look at some open source project code recently, you will always see the use of some of the processing strings in C that begin with "str", some of which have not been used before, and are hereby recorded and added at any time.The source
The following functions are very powerful: not only can emails in html format be sent, but also attachments can be sent.
CheckEmail ($ addressArray [$ I]) = false) return false;} // -- store all valid email addresses in the array $ this-> mailTo =
1. Add the AddcSlashes string to the backslashSyntax: string addcslashes (string str, string charlist );2. Add the AddSlashes string to the backslashSyntax: string addslashes (string str );Add a backslash ('), ", \, or NULL before a specific
Get file suffix, traverse directory hierarchy/** * 5 ways to get the file suffix name * This problem is actually the test function substr () STRRCHR () Array_pop () Strrpos () Strpos () Strrev () explode () pathinfo () * @param s Tring $filename The
1. upload_file.php
// Obtain the extension of the uploaded image and the randomly generated file name.
Header ("content-type: text/html; charset = UTF-8 ");
/**
* Get the file extension
* Enter description here...
*@ ParamUnknown_type $ filename
*
First, what is pseudo-static:Pseudo-static aka URL rewrite, is a dynamic URL that looks like a static URL. In other words, dynamic Web pages are implemented to remove the parameters of a dynamic Web page by overriding the URL method, but there is no
How to download remote files to local storage in PHP
This article mainly introduces how to download remote files from PHP to local storage. The example analyzes the php Remote File Operation Skills, which has some reference value. If you need it,
Php uploads and replaces images,
First, create two files: change.html and change. php.
The form code of the change.html file is as follows:
change file example. file:
Here are a few things to pay attention to. First, let's look
Sharing is a spirit, regardless of the level of technology!
Image thumbnail Dynamic generation-[Code programming]2011-08-23Copyright notice: When reproduced, please indicate the original source and author information and this statement in the
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.