Using the PHP DOM function to achieve simple single page information crawl, see the following code:Error_reporting (E_error);$pages = file_get_contents (' http://www.php100.com ');$pages = Htmlspecialchars ($pages);$doc = new DOMDocument ();$new
Pagination | functions?? Every time you write a list of pages, you almost always write a section of the page. Recently sunny little finally resolved to once and for all?? Customize a paging function and save it in the "pageft.php" file. To use the
1. Preface paging display is a very common way of browsing and displaying large amounts of data, one of the most frequently handled events in Web programming. For the veteran of Web programming, writing this code is as natural as breathing, but for
check box if you have more than one check box with the same name in a form, there is only one value when you submit to PHP, not a comma-separated value like an ASP. There is an easy way to fix this: Add the name of the checkbox after [], for example:
formatted numeric functions Number_format and round
The Number_format () function formats a number by a thousands group.
syntax: Number_format (number,decimals,decimalpoint,separator)
parameter Description
number is required. The number to
PHP data with CSV format uses the Fgetcsv () function.
Use the following statement
$hd =fopen (' test.csv ', ' R ');
$buf =fgetcsv ($HD, 1000, ', ');Open a file in test.csv format, with the contents of the file separated by the "," number.
The
excel| original This is for those who only like to simply deal with Excel friends
Define an Excel file
$workbook = "C:/My Documents/test.xls";
$sheet = "Sheet1";
Generate a COM object $ex
$ex = new COM ("Excel.Sheet") or Die ("Not even!!! ");
Learning Purpose: Make a paging displayThe key is to use the limit in the SQL statement to qualify the displayed records from several to several. We need a variable $page that records the current page and a total number of records $numFor $page if
The syntax above mentions that PHP submits form information is very convenient. But how long is the life cycle of a variable in a form information that is submitted? This article will come to Queensland to talk about this problem.
There is no doubt
Copy CodeThe code is as follows:
#!/usr/local/bin/php-q
Author:freemouse
Here is the description.
Print ("This program is used to merge 2 640x480 sizes. \ n");
Print ("Picture, and convert it to a picture of 400x300 size \ n");
Print ("You need to
Copy CodeThe code is as follows:
/**
* Adapter Mode
*
* Convert the interface of a class to another interface that the customer expects, and those classes that are not compatible to work together can work together
*/
This is the original
ajax| Paging
Pagination should be relatively simple. You can return an XML-formatted table to replace the original table.
1, the dynamic deletion of table content tips, do not need to write too much code, a line:Tb.removenode (True)
2, dynamically
String Iconv (String $in _charset, String $out _charset, String $str)When using this function for string encoding conversions, it is necessary to note that if the utf-8 is converted to gb2312, a string truncation may occur.You can resolve this by
substr (STRRCHR (filename, '. '), 1);-------------------------------------STRRCHR get the last appearance. The word that is lit/SUBSTRsubstr ("ABCdef", 1, 3); Return "BCD"Character interception. From 1 to three.
Related functionsStrstrReturns the
Roughly is not know how many levels of directory below the directory, also do not know how many files, the need to count the size of space, this can be used in albums/database occupancy/network u disk programs.
The general program idea is to use the
Some time ago to see someone using Warcraft to explain the design pattern, feeling very interesting, so I changed it, and added some design mode content, issued today. Some places borrowed from the predecessors of the content, no note, please
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