Remember to run the code before you back up the file Oh, to avoid failure problems.Code One:
function Checkbom ($filename) {
global $auto;
$contents = file_get_contents ($filename);
$charset [1] = substr ($contents, 0, 1);
$
I. PHP dynamic generation
The first step: write the JS code directly in the PHP file, and declare it as a JavaScript file in the header.
Copy Code code as follows:
Step two: Escape JavaScript code with PHP output
Copy Code
Interception of English spam reviews
Because most of the spam comments are in English, so many domestic friends in the use of Some Chinese please plug-in, it can effectively intercept the content of the text without the comment and trackback
This article is an example of how PHP obtains picture information. Share to everyone for your reference, specific as follows:
The getimagesize () function will determine any GIF,JPG,PNG,SWF,SWC,PSD,TIFF,BMP,IFF,JP2,JPX,JB2,JPC,XBM or WBMP The size
Copy Code code as follows:
Get thumbnails of video files
function Getvideocover ($file, $time, $name) {
if (empty ($time)) $time = ' 1 ';//default intercept first second frame
$strlen = strlen ($file);
$videoCover = substr ($file, 0,
Morning just to the company, the head told me, to write a small function, used to statistics specified in the directory file size, I have a go, do it, fortunately a little foundation, a will be completed, haha. The code is below.
?
/**
As we all know, PHP code needs a Web server to execute, to test the PHP code will have to build a Web server, which gives us a lot of inconvenience in peacetime learning. But after the PHP v5.4 version, PHP will bring a simple Web server.
Start the
Rule 1: Never trust external data or input
The first thing you must realize about WEB application security is that you should not trust external data. External data (outside) includes any data that is not entered directly by the programmer in the
Copy Code code as follows:
/* Picture upload class only jpg format picture * *
Class UploadFile
{
var $inputName; Input name
var $fileName; File naming
var $fileProperty; File properties
var $fileSize = 2097152; File size limit, 2M
var
Twilight, Hello!
Rainbird sent you a short message:
has written a lot of backstage running Deamon. Quite handy, but now I want to get the content of the pipeline, I do not know how to achieve, similar to echo "AAAA" |a.php,a.php how to get the
So far, the official PHP has released the RC5 version of PHP7, is expected to release the first official version around November! For now, PHP7 's major features must have been stereotyped, and there will be no further changes. Later iterations are
This example describes how PHP uses mkdir to create a multilevel catalog. Share to everyone for your reference, specific as follows:
PHP uses mkdir () to create a multilevel directory, which is very useful compared to your own first-level creation.
A simple exampleThere is a database of student information, you need to delete more than one recordCreate a file named del.phpThe code is as follows:
Copy Code code as follows:
Student Information Table
Options Learning No.
Copy Code code as follows:
The search function $array the array, $k the value to find, $low the minimum key value for the lookup range, $high the maximum key value for the lookup range
function Search ($array, $k, $low =0, $high =0)
{
if
A lottery small program, introduction can be controlled, but also a prize in front of the display, and the program is simply impossible to obtain! By adding all the probabilities x10, the value of each item in the new array equals its first few and
1, the interception of GB2312 characters used in the function
PHP code
Copy Code code as follows:
Intercepting Chinese strings
function Mysubstr ($str, $start, $len) {
$tmpstr = "";
$strlen = $start + $len;
for ($i = 0; $i if
Add ($key, $value, $expiry);
$key: Unique identification, used to differentiate written data
$value: Data to write
$expiry: Expiration time, default is always valid
Purpose: Write data to Memcache
Get ($key)
$key: Get the corresponding data by $key
Get_avatar () (Get Avatar)the Get_avatar () function is used to get the top mailbox or the user's avatar code, which is very common in the comment list.
This function provides a Get_avatar filter to filter the Avatar's Html code (the IMG tag).
Attention to the area of the transfer codeBaidu AK Application Address: Http://lbsyun.baidu.com/apiconsole/key
Copy Code code as follows:
$city = "Jiaxing";$content = file_get_contents
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