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 =
Configure database parameters in ZendFramework
Configure database parameters in Zend Framework
I created a zend framework project using zend studio 7.2.1.
That is to say, my framework was created by zend stduio7.2.1 to help
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 )){
Php implements five basic operations on text databases: data display, addition, modification, deletion, and query.
Php implements five basic operations on text databases: data display, addition, modification, deletion, and query.This text
PHP relative path problems
PHP FastCgi in IIS Require path cache problems The require Series functions have the same relative paths.
/* PHP FastCgi problems in IIS
Require path cache problems
The require Series
A Practical php paging class
/*
Functional and practical php paging class
Subpages
*/
Class SubPages {
Private $ each_disNums; // Number of Entries displayed on each page
Private $
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
My own php date capturing
My own php date capturing
Echo j7_getdate ('Y-m-D', '2017-11-15 ',' + 10 Day ');
Function j7_getdate ($ format, $ time = 'Now ', $ opt ){
Return date ("$ format", strtotime ("
Returns a random string.
Returns a random string.
/*
Purpose: obtain a random string.
Parameters:
1. (int) $ length = 32 # random character length. the default value is 32.
2. (int) $ mode = 0 # random
Double-byte character truncation
Double-byte truncation, such as truncation of Chinese characters and English-mixed texts
Function substr ($ string, $ length)
{
$ I = 0;
$ J = 0;
While ($ I
Method 4: traverse all files and folders in a folder
Traverse all files and folders in a folder
Function list_dir ($ dirpath ){
If ($ dirpath [strlen ($ dirpath)-1]! = "\") {$ Dirpath. = "\\";}
Static $ result_array =
PHPheader () function usage
Note: No matter how many headers are on the page, it executes the last one, but it is conditional. for example:
Header ('Location: http://bbs.it-home.org ');
Header ('Location:
Use php to obtain table field information
To obtain field information in php, you can use the followingFunction: Mysql_fetch_field () mysql_num_fields () mysql_list_fields () mysql_field_flags () mysql_field_len () mysql_field_name () mysql_
Sprintf: sprintfphpsprintf function makes your SQL operations safer: $ bookSQLsprintf (UPDATEbookSETpass % sWHERE, GetSQLValueString ($ _ POST [list], text), GetSQLValueString ($ _ GET [id], int); Ge $ bookSQL = sprintf ("UPDATE book SET pass = % s
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