Learning the fwrite function of php
This article introduces the usage of the fwrite function in php for your reference. The PHP fwrite () function is used to write strings to a file. the number of written characters is returned. otherwise,
The file size in bytes is converted to an appropriate unit.
Someone has shared code like this. Share a piece of code that supports any large number and is quite simple.
Function formatFileSize ($ fileSize)
{
$ Unit =
Method 2 of tree traversal
A non-recursive depth-first algorithm is implemented using a stack.
Define ('Ds', DIRECTORY_SEPARATOR );
Function deep_first_list_files ($ from = '.')
{
If (! Is_dir ($ from )){
An elegant byte-related conversion formula
Function parsing
/**
* @ Desc convert to the number of nodes
* Pay attention to its case usage. Because break is not written, an elegant conversion formula can be
Phpmailer mail class library
Phpmailer mail class library
Header ('content-Type: text/html; charset = utf-8 ');
Require ("phpmailer/class. phpmailer. php ");
Error_reporting (E_ERROR );
Function
PHP + MYSQL page feed
In this program, the new class FENYE inherits the class DBSQL. Therefore, in the new class destructor, the parent class destructor is called to connect to the database, the config file contains the global variable
Use php to compare the similarities and differences between the two folders
Requirement: you can only use command lines to compare the differences between two folders, including the differences between files.Thinking: Although there is diff
Determines whether the input is a pure number, English or Chinese character.
Using the mb_strlen and strlen functions of php, you can easily know whether the string is composed of English letters, English letters and Chinese characters, or
Php file download instance code
If you use php to implement forced file download, the header function is usually used. Example: PHP file download instance.
Class Downfile {
Function downserver ($ file_name ){
Yii learning (1) -- install and configure
I have previously written Yii articles on sina's blog. I haven't written any more articles about Yii since I came to the blog Park. it's just that I have nothing to do with the Dragon Boat Festival
Thinkphp _ template operation
Quick output variable
{: Function (...)} // Execute the method and output the returned value
{~ Function} // the execution method is not output
{@ Var} // output the Session variable
{#
Example of PHP function overloading tips
Php, as a weak type language, cannot directly implement overload like a strong type such as java or c ++.Function overloading can be indirectly implemented through some methods.1. you can use the
Photoshop learning: photoshop learning PHP learning operator and operator priority: arithmetic operator name result $ a + $ B addition $ the sum of a and $ B and $ a-$ B subtraction $ the difference between a and $ B $ a * $ B multiplication $ a and
Infinitus China Ltd.: Infinitus China Ltd. php Infinitus classification: Copy the code as follows: & lt ;? Php * class name: catalog function: unlimited classification class method: tree display category catalog_show ($ id) parameter $ id recursive
Document. cookie: document. cookie scope in cookiephp: setcookie (cookie name, value, scope) "Scope" "indicates that the COOKIE applies to all files under the ROOT directory." ROOT "indicates that the COOKIE applies to all files under the ROOT
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