This article analyzes the usage of opendir function in PHP. Share to everyone for your reference. Specifically as follows:
Opendir syntax: Opendir (Path,context)
Directory, feature Description: Open a directory handle, the Opendir () function
In web development, we may encounter the need to empty all the files in a directory without deleting the subdirectories (and of course not deleting the deleted root directory). So what do you do with a way to delete a file without deleting the
1.resource fopen (String $filename, String $mode [, bool $use _include_path [, Resource $zcontext]])function Function:fopen () binds the name resource specified by filename to a stream. If filename is "scheme://..." Format, the Search protocol
We sometimes encounter situations where downloading a PDF file, if not processed, opens the PDF file directly in the browser, and then you need to save the download file by saving it. This article will be implemented through PHP to download the pdf
The Strstr () function searches for a string that appears for the first time in another string. The function returns the remainder of the string (from a match point). returns false if the searched string is not found.
Syntax: Strstr (String,search)
Here are nine PHP useful features, do not know you have used it?1. Any number of parameters of the functionYou may know that PHP allows you to define a function of a default parameter. But you may not know that PHP also allows you to define a
Common magic Methods are: __tostring () __call () __autoload () __ Clone () __get () __set () __isset () __unset ()1.__tostring () When you define an output object reference, the information that is often used to print some objects must have a
The HTTP protocol is a stateless protocol, which means that every request you make to the site is independent and therefore cannot be saved by itself. But this simplicity is one of the reasons it has spread widely in the early days of the
Today, when I write the program, suddenly found a long time ago to get the number of days of the function, the classic switch version, but to get the number of days last month, I just put the month-1, I guess it was too sleepy, and then see a kind
Let me give you an example:For example, you can return a function in these situations:1, the number greater than 02, less than 0 of the number3, equal to 0 of the number (that is, 0)4, False (when failed)If you want to catch failure, you must use = =
Principle:UTF8 file, Microsoft to add a recognition information, with the BOM this thing: Bom--byte order mark, the default on Windows and other platforms edited UTF8 file will add 3 bytes of markup information on the head, Our PHP engine in the
Ceil is a function of rounding up to get a value;Floor is a function of dropping a decimal bit to get a value;Round is a function for rounding.
CeilDefinition and Usage:The Ceil () function is rounded up to the nearest integer.
Copy Code code
with PHP Ob_start ();
Control your browser cache
The output control function gives you a free rein in the outputs of the data in the script. It's very useful, especially for: when you want to output the file header after the data has been exported.
Copy Code code as follows:
$file = fopen (' text.csv ', ' R ');
while ($data = Fgetcsv ($file)) {//read one line in CSV every timePrint_r ($data); This is an array, to obtain each data, access to the array subscript can$goods _list[] =
Just contact to the problem, I did not take into account the iterator mode, tried a few general ideas, after the failure .... Directly to look at the source of the implementation of foreach, expect to find a foreach processing object when there is
Today, I share with you the premise of not refreshing the page, using Php+jquery+ajax to achieve multiple image upload effect. Users simply click to select the image to upload, and the picture is automatically uploaded to the server and displayed on
Examples of common PHP sorting algorithms: [basic sorting, Bubble sorting, fast sorting, insert sorting], algorithm Summary
This example summarizes common PHP sorting algorithms. We will share this with you for your reference. The details are as
[Chatting with PHP] The beauty of Loli in the programming field -- PHP, -- php
Address of this Article
01 Preface -- boarding a thief ship
I don't know when I got on the PHP thief ship and started web development. I remember I was a person 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service