This article to give you a summary of some of the commonly used folder/file directory operation function Summary in PHP, these are simply to introduce some basic methods, hoping to help the novice.
PHP folder operation function
String basename
In PHP to delete the function is more specific than JS, in addition to the trim () function, there are LTrim () and RTrim () function, they have to delete the left and right space, in addition to these three functions can also use regular
Many programmers are using
Note: This document is based on the include narrative but also applies to require. These two structures are exactly the same in addition to how they handle containment failures: When inclusion fails, the include ()
We are using1, the use of mbstring Extension Library MB_SUBSTR interception will not appear garbled.
2, write the interception function, but the efficiency is not as high as the Mbstring expansion library.
3, if only for the output interception of
Finding the number of occurrences of a string in PHP can be done by using the Substr_count () function, and I'll give you a detailed introduction to these functions.
Substr_count ($haystack, $needle [, $offset [, $length]])
/$haystack represents a
But if it is a news system, or a content publishing system. Both of these, it is very necessary to use the technology template. Because they all have a common place, is a kind of page to use the same style page design. And according to the actual
Through the
1. Framework
The framework can be said to be one of the most important issues in PHP developer development. There are many ways to develop Web applications in PHP, and there are many open-source frameworks that can be used to help you
Everyone is right.If you declare a function in a class named __construct, the function will be treated as a constructor and executed when an object instance is created. Clearly, __ is an underscore of two. Just like any other function, the PHP 5.0
In the current rapid development of the Internet business, new products such as springing up, the old product line new business is also constantly breaking and trying. This puts a higher demand on the rapid development iterations.
First, the basic
Create a field in the database, record the file name, each file is generated, the automatically generated file name is stored in the database, for the recommended article, just point to the page in the specified folder that holds the static file.
Ex-Google + has released an OAuth application programming interface that now provides only user activity and looping data. I've used PHP to easily implement a login system called user authentication via Google + data. Try this almost like a Twitter
For learningI began by referring to other methods, using unset, but with a flaw. A $ A is an array:
$ a = Array ("Red", "green", "blue", "yellow");
Count ($a); Get 4
unset
PHP shows MySQL garbled problem 1. Using the phpMyAdmin operation MySQL database Chinese character display is normal, but the PHP page displays MySQL data when all Chinese characters have become the number.
Symptoms: Using phpMyAdmin to enter
PHPAs an open source language, the development of a lot of mature domestic and foreign open source system, enough to meet the individual and enterprise users themselves to establish a Web site, the following is the main introduction of the PHP
Everyone through thephp function sizeof () syntax:
sizeof (ARRAYNAME);
Tips and Instructions
Note: This feature may return 0 if a variable is not set, but may also return 0 if a variable contains an empty array. The Isset () function can be used to
description and explanation of the PHP extension library:
Php_bz2.dll bzip2 compression Function Library NoPhp_calendar.dll Calendar conversion function library from PHP 4.0.3 Built-inPhp_cpdf.dll ClibPDF Function Library NonePhp_crack.dll password
We are using
PHP has two main processes for exporting Excel files:
1. Define file name
2. Populate Excel data
These two processes may appear some PHP export Excel garbled problem, below I say the solution:
Resolve file name of PHP export Excel
When using
Examples of how PHP Domxpath are used:
? PHP
Header ("content-type:text/html; Charset=utf-8 ");
$ URL = "http://www.google.com/ig/Api?weather=shenzhen ";
Loading XML content
$ Dom = New DOMDocument
In learningYour users may be excellent, and most users may use the application exactly as expected. However, as long as the opportunity to enter is provided, there is a high likelihood of very bad input. As an application developer, you must prevent
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