Two open-source Php output Excel files

1. php-excel Php-excel is a very simple library for generating excel documents from php on-the-fly. Http://code.google.com/p/php-excel/Download scriptsHttp://www.jb51.net/codes/24319.html2. PHPExcel Project providing a set of classes for the PHP

Php 8-hour time difference solution Summary

The date. timezone option has been added to php. ini since php5.1.0. It is disabled by default.That is, the displayed time (no matter what php Command is used) is the Greenwich Mean Time.The difference between the time and our time (Beijing time) is

Collect regular code from php articles

Copy codeThe Code is as follows:// Collect htmlFunction getwebcontent ($ url ){$ Ch = curl_init ();$ Timeout = 10;Curl_setopt ($ ch, CURLOPT_URL, $ url );Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1 );Curl_setopt ($ ch, CURLOPT_CONNECTTIMEOUT, $

Convert XML to an array in php

Copy codeThe Code is as follows:// Convert Xml to an array, including the Root KeyFunction xml_to_array ($ xml){$ Reg = "/] *> ([\ x00-\ xFF] *) /";If (preg_match_all ($ reg, $ xml, $ matches )){$ Count = count ($ matches [0]);For ($ I = 0; $ I {$

Use of the encoding and conversion functions mb_convert_encoding and iconv in PHP

However, the English language generally does not have Encoding Problems. Only Chinese data can have this problem. For example, when you use Zend Studio or Editplus to write a program, you use gbk encoding. If the data needs to be imported into the

Summary of debugging technology for PHP programmers

This article describes various methods for debugging PHP applications, including opening error reports in Apache and PHP, and placing strategic print statements in a simple PHP script, find the source of a more difficult bug. The PHPEclipse plug-in

PHP Session variables cannot be transmitted to the next page

I think the reasons for this problem are as follows:1. cookie disabled on the client2. a browser error occurs and the cookie cannot be accessed for the moment.3. The session. use_trans_sid in php. ini is 0 or the -- enable-trans-sid option is not

Php foreach and while performance comparison

Foreach performs operations on Array replicas (by copying arrays), while operations are performed by moving internal indicators of the array. Generally, it is logically considered that, while should be faster than foreach (because foreach first

PHP string = side effects of comparison Operators

Copy codeThe Code is as follows:$ A = '000000 ';$ B = '000000 ';Var_dump ($ a = $ B ); The output of this Code is bool (true), indicating that the two are equal. similar features are applicable when the 3rd in_array () function parameters are false

PHP tutorial variable definition

Variables in PHPVariables are used to store values, such as numbers, text strings, or arrays.Once a variable is set, we can reuse it in the script.All variables in PHP start with the $ symbol, and the variable names are case sensitive.The correct

PHP character truncation solves the problem of Chinese Character truncation without using the mb Series

Copy codeThe Code is as follows:Function Cut_string ($ string, $ start, $ sublen, $ extstring = '...', $ code = 'utf-8') {// start with Cut_stringIf ($ code = 'utf-8 '){$ Pa = "/[\ x01-\ x7f] | [\ xc2-\ xdf] [\ x80-\ xbf] | \ xe0 [\ xa0-\ xbf] [\ x80

PHP authentication functions

Copy codeThe Code is as follows: // Calculate the ID card verification code based on the National Standard GB 11643-1999Function idcard_verify_number ($ idcard_base ){If (strlen ($ idcard_base )! = 17) {return false ;}// Weighting Factor$ Factor =

PHPLog php program debugging Tracing Tool

Principle:1. In the process of program execution, record the variables you want to track and the parameters of the Call Stack and each function call,Record the information to the file in a certain format, with one variable row. For details about the

PHP File Upload method (class)

Copy codeThe Code is as follows:/*** Image Upload Method* $ Maxsize = 500000 = 500 k;* $ Updir = "up /";* $ Upfile = $ _ FILES ["file_img"];*/Public function Get_file_upload ($ upfile, $ maxsize, $ updir, $ newname = 'date '){If ($ newname = 'date ')

Php SQL Server connection failure Problem and Solution

1. Confirm the Database Service Activation status2. enable extension in php. ini configuration3. Check database-related versions(1) In Sql2000, check whether the version of the ntwdblib. dll file under the php Directory and apache bin directory is

PHP-generated XML is obtained in FLASH as garbled code.

It is finally solved through exploration. By the way, general solutions are also recorded. If you also encounter XML FLASH garbled characters, you can quickly query:1. Make sure that XML is absolutely correct:First, garbled characters occur when

Use of the php error_log Function

Let's take a rough look at the error_log () function. Let's take a look at the manual explanation: Error_log(PHP 3, PHP 4, PHP 5) Bool error_log (string message [, int message_type [, string destination [, string extra_headers])The error log that

A php code for exporting the oracle database

$ Conn = OCILogon ("username", "password", "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = IP) (PORT = 1521 )) (CONNECT_DATA = (SID = lcx )))");// $ SQL = "select * from all_tab_columns where table_name = 'member'"; // Table Structure$ SQL =

The string intercepted by PHP is applicable to GB2312 and UTF8 encoding respectively.

1. truncate the GB2312 Chinese String Copy codeThe Code is as follows:// Truncate a Chinese StringFunction mysubstr ($ str, $ start, $ len ){$ Tmpstr = "";$ Strlen = $ start + $ len;For ($ I = 0; $ I If (ord (substr ($ str, $ I, 1)> 0xa0 ){$ Tmpstr.

Summary of prereserved variables of php smarty

The following are examples of access page request variables such as get, post, cookies, server, enviroment, and session variables. for example, {$ smarty. server. SERVER_NAME} gets the server variable, {$ smarty. env. PATH} obtains the path of the

Total Pages: 12780 1 .... 9200 9201 9202 9203 9204 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.