The batch upload method is also very simple. We only need to add a name = \ "pictures [] \" array to the form, then use foreach ($ _ FILES [\ "pictures \"] [\ "error \"] as $ key => $ error) to cyclically judge the array, and then use
This article briefly introduces the usage of static variables in php functions. For more information, see.
The Code is as follows:
Copy code
Function sendHeader ($ num, $ rtarr = null){Static $ sapi = null;If ($ sapi = null){$
Let's take a look at the php Manual. The file_get_contents () function reads the entire file into a string like file (). The difference is that file_get_contents () reads the file into a string.
The file_get_contents () function is the preferred
Next we will introduce the usage of var_export and var_dump. If you need it, please refer to it.
Var_export must return valid php code, that is, the Code returned by var_export can be directly assigned a variable as a php code. And this variable
We usually use array () to define data in php. If you do not know the length of the array, you can define the length of the unknown data as array, if you want to clear the data, you can directly unset (array [key]) or directly reset the value to
In php, you can use the filemtime () function to obtain the file modification time. It can return the last modification time of the file content.
If successful, the time is returned in Unix timestamp format. If it fails, false is returned.
Filemtime
The method for checking the variable type in php is very simple. You can use the gettype () function to return the current variable type. Next I will introduce you to the gettype function to check the variable type in detail, for more information,
Many of my friends asked me how to judge the php empty array. I will summarize some common code used to judge the empty array program. If you need to know it, please refer to it.
Empty function, which determines that the array value is null
This article will summarize some usage of PHP constant types. This is a friend's learning note. I will share it with you.
Once a constant in PHP is defined, it cannot be changed or undefined. constants have predefined constants (internal constants)
Memory_limit is php. an important parameter in ini, which can limit the maximum memory usage of php. If it is small, it will cause Fatal Error: allowed memory size of xxxxxx bytes exhausted error. Let's take a look at the solution.
Edit php. ini.
A simple php File Upload class is an image processing class found during PHP class sorting. php has many image processing classes, including processing images separately and adding watermarks, there are also images generated. In short, it is very
We know that php arrays are divided into multi-dimensional arrays and one-dimensional arrays. Next we will introduce the principles and implementation methods of sorting php multi-dimensional arrays and one-dimensional arrays
The static page looks good. You cannot directly call the PHP file, but you can use js to call the PHP file. Of course, you can also use ajax to call the PHP file. Here I will introduce it to you.
Here is a simple example: For example, you can call
In php, there are many ways to merge arrays in a simple way, but today I want to merge arrays based on the array ID and then re-merge the arrays based on categories.
To merge the simplest arrays, we only need to use array_merge.
Array_merge ()
/*** Ecshop jpgraph chart class library* ===================================================== ======================================* The open-source jpgraph library is used to display various types of data in charts and trend charts.* =============
If you want to use php to add a background tile watermark to an image, you must use a php plug-in to add a background tile watermark to the image by using imagick, below we provide an instance code.
If you want to useAdd a background tile watermark
Imagecreatetruecolor () returns an image identifier representing a black image of the specified size.
According to your php tutorial and function definition in the gd version. For php 4.0.6, the function 4.1.x always exists.
,*/$ Im =
A PHP smart thumbnails class for generating images, which can automatically generate proportional images based on the size of your images. For more information, see.
The Code is as follows:
Copy code
/*************************
Upload an image file using php and generate a scaled thumbnail. For more information, see.
The Code is as follows:
Copy code
Function _ UPLOADPIC ($ upfile, $ maxsize, $ updir, $ newname = 'date '){If ($ newname = 'date ')$
This is a basic thing. We can use constructor to automatically connect to the mysql server when creating classes. We only need to set $ name, $ pass, the value of $ table is enough.
The Code is as follows:
Copy code
Class
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