This article introduces the implementation of the code in PHP to write Excel files, including the title and content. Refer to a friend who needs it.PHP writes Excel files, including headings. This is often used in daily development, such as a number
After learning HTML and the basis of PHP, writing this project also has a period of time, in the process of writing can be said to be more systematic learning of some things, but also more profound some so-called experience need to accumulate the
/**
* Randomly display the specified text
* by bbs.it-home.org
*/
function Getrand () {
$a =rand (1,5);
if ($a ==1) {
echo "It's sunny today!" ";
}elseif ($a ==2) {
echo "The Great Sun Today";
/**
* Get the physical (MAC) address of the machine card
* Currently supports Win/linux system
* Editor: Bbs.it-home.org
**/
Class Macaddinfo {
var $return _array = Array (); Returns an array of strings with MAC
/**
* Block specified IP address access, but do not block search engine spiders
* by bbs.it-home.org
*/
function Get_ip_data () {
$ip =file_get_contents ("http://ip.taobao.com/service/getIpInfo.php?ip=". GET_CLIENT_IP ());
This article shares a PHP upload image code, through the built-in PHP function to achieve file upload, the need for friends reference.1,form form Section
2, upload the image file PHP code
$max _size) {echo ' file is too large
An example of the function of collecting picture in PHP
if ($url = = ") {return false;} $ext = STRRCHR ($url, '. '); if ($ext! = '. gif ' && $ext! = '. jpg ') {return false;} //Determine if!is_dir exists ($f Ilepath)? mkdir ($filepath): null;
This article introduces, PHP implementation of a mail sending class, based on text template to send mail, very good, have the need for friends to refer to the next bar.A PHP email send class, you can construct a simple message format, the effect is
This article describes the use of the mysql_fetch_array () function in PHP, which returns data query results as an array. Refer to a friend who needs it.PHP Data query result function: mysql_fetch_array () function. Returns the data query result as
Php_user_info
--------------------
UID Username password
User's ID user name password
--------------------
Copy Code2. Save the table for the information sent to the user. For example:
/*----------------
* $FileName is the file name, must pass
* $FilePath is the file path. Optional, can be a relative path or an absolute path
* The @ path can only be composed of English and data, not with Chinese
* Edit
$users = Array ("qdv.cn", "haotu.net", "sharejs.com", "google.com");
Print count ($users)-1;
Copy CodeExample 2,php gets the usage of the array's length function count.Example 2,count function to get the length of an array
Format output Directory size unit: BYTES,KB,MB,GB
can also be used to count the number of catalogs
Site bbs.it-home.org
function Getdirectorysize ($path)
{
$totalsize = 0;
$totalcount = 0;
$dircount = 0;
if
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