Php downloads excel files,1. Do not output any non-file information, such as echo log information, during the download process. Otherwise, the downloaded file cannot be opened and the system prompts that the format is incorrect or the file is
Copy codeThe Code is as follows:Function unicode_encode ($ name){$ Name = iconv ('utf-8', 'ucs-2', $ name );$ Len = strlen ($ name );$ Str = '';For ($ I = 0; $ I {$ C = $ name [$ I];$ C2 = $ name [$ I + 1];If (ord ($ c)> 0){// Two-byte text$ Str. = '
Text watermark
A text watermark adds text to an image. It mainly uses the imagefttext method of the gd library and requires a font file. As follows:
The implementation code is as follows:
Copy codeThe Code is as follows:$ Dst_path = 'dst.jpg ';
//
There are two methods to implement the fnmatch function in this post. The post is as follows:
Function fnmatch ($ pattern, $ string) // $ pattern match, $ string matched string {$ starStack = array (); // create a stack at the starting position
I have previously introduced the internal lifecycle of php and the thread security mechanism of Zend engine. Here this article mainly introduces how php internal variables are implemented.
After learning about these implementation methods, it is
A good php code, whether in windows or linux, different versions of php, can correctly output the results, is a good code.It is not easy to do things that are easy to say. In many cases, writing code is function-oriented. In the current environment,
Author: Deep Space Source: Beyond PHPIn my opinion, the Class used in PHP is an informal language and cannot be determined whether it is correct.Creating a class is simple:Class my_class {}What is the class? Many people refer to it as a black box.
Check that PHP and MYSQL are all in the new version. If you want to try it, try to install it and write down the installation process. I hope it will be helpful for new users who want to learn PHP, bamboo can be refined.Simple installation of Apache2
If we want to match Chinese Characters in php and js, we only need to use regular expressions/^ [\ x {4e00}-\ x {9fa5}] + $/u, match double-byte characters (including Chinese characters): [^/x00-/xff ].
Js version
Regular Expression matching
There are many methods to create files in php: fopen and file_put_contents, which are the most commonly used methods to create files. I will introduce them in detail below, for more information, see.
Create a PHP File
The Code is as
After reading the article "how to call the Asscess database and COM program through ADO in PHP", I immediately did the test and the result failed. Sad.What should I do? I had to go to the official PHP website for help, and Huang Tianyan had no
Use PHP to call the database storage process!Author: fox4000Yesterday, I saw a comrade-in-arms asking if I could use php to call the storage process. I thought it was okay. So I started the experiment right away and it was very successful! Beyond my
As soon as we learned programming, we knew various sorting algorithms. Now let's take a look at the usage of the php bubble Algorithm in practical applications. If you need it, let's take a simple reference.
The Code is as follows:
Copy
To quickly obtain the index value, we can use the php array_values () function to quickly and concisely find what we want. Next, let's take a look at the usage of the array_values () function.
The array_keys () function returns a new array
This article introduces the new php knowledge about the file entry usage of the MVC Framework in PHP. For more information, see this article.
How to write the MVC file entry is completely based on the programmer's engine design and the programmer's
Question: All Chinese characters read from the database are "?".Solution:Step 1: register the Code Page to enable SQL Server to support Chinese Characters1. copy the file C_936.nls to the system32 directory under the system directory.2.use regedit32.
: I created a table in ms SQL, but some records are repeated for various reasons.: The records are exactly the same.: Now I want to delete all the duplicates and only keep the first record.: I see oracle introduction in the database,Select distinct *
ACCESS is an excellent front-end development tool for Client/Server. It is easy to learn and use, has a friendly interface, and has simple development, and is flexible with other database interfaces. However, it is slow to process a large amount of
Some time ago I shared an example of the php implementation progress bar. I think the example is a little copied and not very practical. today I will share a relatively simple php implementation progress bar case:
Some time ago I shared an example
Recursion_limit limits the maximum number of regex-nested layers. if this value is set to too large, the stack space may be exhausted. the default 100000 may be too large...
Today, Tank asked a question about the following regular expressions:
/
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