There are times when you are working on a file that needs to be processed in batches in a directory, this time we need to find all the eligible files in the directory and save them to a result set, and then make it easy to batch, usually by saving
Just look at the code, it's a simple PHP class
Copy Code code as follows:
$IDCard = new Idcard ();
Var_dump ($IDCard:: Iscard ($_get[' card '));
/**
* ID card processing class
*/
class Idcard {
//Check ID card
When converted to Boolean, the following values are considered FALSE:
The Boolean value FALSE itself
The value of the integer 0 (0)
The floating-point value of 0.0 (0)
empty string, and string "0"
An array that does not include any elements
Save the following code as uploads.php
Copy Code code as follows:
Please select File: ?
function File_list ($dir, $pattern = "") {
$arr =array ();
$dir _handle=opendir ($dir);
if ($dir _handle) {
while (($file =readdir ($dir
Instructions for use:
1. Remove the "Extension=php_gd2.dll" line in front of the php.ini file, because we need to use the GD library;
2. Change Extension_dir = to the directory where your Php_gd2.dll is located;
Copy Code code as follows:
Look at the POP3/SMTP protocol when you want to try to write a class, the core is nothing, is the use of fsockopen, and then write/Receive data, only to achieve the most core part of the function, as a learning Socket operation of the practicing. It
PHP four basic algorithms: Bubble, select, insert, and fast sorting methodMany people have said that the algorithm is the core of the program, a program is better than the poor, the key is the pros and cons of this program algorithm. As a primary
The examples in this article describe the simple pagination classes and usage of PHP implementations. Share to everyone for your reference, specific as follows:
page;
* * Get the total number of pages * $page->pagecount;
* * Total Record
This article illustrates how PHP uses the header function, PHP_AUTH_PW and php_auth_user to do user authentication. Share to everyone for your reference, specific as follows:
In PHP, you can use the header function to do some interesting things,
The example in this article describes how PHP uses FFmpeg to get video information and screenshots. Share to everyone for your reference, specific as follows:
$movie = new Ffmpeg_movie (' 4.mp4 ');
$width = $movie->getframewidth ();
$height = $
Xu Zuning PHP version of the Escape/unescape function
Copy Code code as follows:
function Escape ($STR) {
Preg_match_all ("/[\x80-\xff].| [\x01-\x7f]+/", $str, $r);
$ar = $r [0];
foreach ($ar as $k => $v) {
if (Ord ($v [0]) $ar [$k] =
As time went by, the two bright spots grew brighter, and soon they were loved by programmers, and there was a question: what would happen if they met? Is it possible to combine their strengths?
Trying to build a bridge between PHP and Java, using
Collected from the Internet, is said to be Yahoo's face test questions.
1. Which of the following won't add John to the users array?
1. $users [] = ' John ';
2. Array_add ($users, ' John '); Wrong
3. Array_push ($users, ' John ');
4. $users | | = '
This section shares the PHP code, the main features:Gets the physical (MAC) address of the machine's network card.Code:
Copy Code code as follows:
/**
* Obtain the physical (MAC) address of the Machine network card
* Currently
The content of this section:PHP functions Specify default valuesIn PHP programming, a default value is set for a custom function, and when the user calls the function, the parameter is replaced with the default value if the parameter is not assigned
Overview
Shared memory is an efficient way to exchange data between applications in the same machine. A process can create a segment of memory that can be accessed by another process as long as it has the correct permissions assigned to it. Each
First, use ApacheInstallation of ≡php 5.2.5
1, to its official site download Php-5.2.5-win32.zip and decompression (said: Do not download and use its installer, this way although very automated, very intelligent, but there are many aspects of the
Checkdate ($month, $date, $year)If the value that is applied constitutes a valid date, the function returns True. For example, for an error date of February 31, 2005, this function returns to False.
You can use this function to check the date and
1, User logon Status Action class Userlogin
find ($_cookie["user_id"]); if ($user) {$_session["user_info"] = $user; Setcookie ("Docloud_sid", session_id (), time () + 36000); Setcookie ("user_id",
$_cookie["user_id"], time () + 36000);
Environment
Server operating system: CentOS 7.0
Blog Deployment server: Apache
Background language: PHP
Database: MYSQL
Front End frame: WordPress
Steps
First, install Apache
It's easy to install Apache simply by typing 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service