Function zhuanhuan (){$ Urlodd = explode (//, $ _ GET ["url"], 2); // divide the link into 2 segments. // The first segment is followed by the second segment.$ Head = strtolower ($ urlodd [0]); // PHP is case sensitive, which is first converted to
PHP implements autoload in two ways:
1. interceptor _ autoload ()
2. Set the global variable function pointer autoload_func as the specified function. Usually used in c Extension
In essence, the former is implemented through the latter.
Analysis
1. Download php 5.3 for Windows.
2. Configure the php. ini file in the php installation directory: Remove ";" before date. timezone and change it to date. timezone = Asia/Shanghai.
3. Select "World Wide Web Service"> "application development
DIRECTORY_SEPARATOR is an internal constant of php. It is used to display system separator commands and can be directly used without any definition or inclusion.
In windows, the path separator is (of course, it can also run normally On some systems).
/** Log on to */public function Login (){
If ($ _ POST [submit]) {
$ DB = D (Login); // custom Model processing
// If is automatically verified by ThinkPHP.
If (! $ DB-> create ()){
$ This-> redirect (Index/Login, 3, error message :. $ DB->
In PHP 5.3, if you want to introduce some classes with a long name, it will be difficult to write. At this timeYou can use the alias of PHP 5.3 class, for example:
Class Irrational_Long_Class_Name{// Empty class}
Class_alias
The shuffle () function sorts the elements in the array in random order.
If yes, TRUE is returned. Otherwise, FALSE is returned.
Note: This function assigns a new key name to the cell in the array. This will delete the original key name, not just
PHP ignore_user_abort, connection_status, and register_shutdown_function usageUse ignore_user_abort () to schedule tasks in PHPSyntax: int ignore_user_abort (int [setting]);Return Value: integerFunction types: PHP system functionsDescription0-NORMAL
Generally, it is a PHP. ini configuration problem. Set it again based on the following configuration items, and then restart the server. Try again!
(1) set the extension path
Find the row in extension_dir
; Extension_dir = "./"
Add a line
Paging is currently the best way to display a large number of results. With the help of the following code, developers can display a large amount of data on multiple pages. On the Internet, pages are generally used for search results or browsing all
#1 do not like Unity? Switch to Ubuntu gnome classic Desktop
Log out of the unity desktop environment and select "classic desktop" as the logon environment.What if you like Unity, but your graphics card is not supported by 3D? Install Unity-2D:Sudo
Explode
Explode-use one string to separate another stringArray explode (string $ separator, string $ string [, int $ limit])
This function returns an array composed of strings. Each element is a substring of a string, which is separated by a string
Array syntaxDefine array ()You can use the array () language structure to create an array. It accepts any number of key => value pairs separated by commas.Array (key => value,...)// The key is an integer or string)// Value can be of any type$ Arr =
Php codeDiscuz! SESSION mechanism in X In Discuz! As always in X, the SESSION does not use the SESSION mechanism that comes with PHP, but is a set of built-in mechanisms of the system. There are two SESSION tables in the database:One is
1. Use echo, print, print_r, var_export, or var_dump to directly output data to the browser.In this case, there is no interruption or jump in the middle of the page, usually followed by exit.After the project is officially launched, will the
In PHP, is_file and file_isexist have very small cells.1) is_file:$ Path = "/path/to/file/text.txt ";If (file_exists ($ path ))Echo "File Exists ";ElseEcho "File not Exists ";For example, in this example, if a file exists, true is returned, and
Get_current_user () Get the name of the owner of the current PHP script
Substr (sprintf ("% o", fileperms (getcwd (),-4) Get current file/directory permissions
Scandir (getcwd () obtains all files/directories in the current directory.
Print_r (posix_
1. session Generation Mechanism in php
Let's analyze how a session is generated in PHP. The purpose of the session design is to maintain the various statuses of each user to make up for the shortcomings of the HTTP protocol (stateless ). We
This code can print the number of random lines in the text. For example, if one text contains 1 million lines, I need to randomly retrieve 500 lines.
1. $ file = "txt ";
2. $ data = file_get_contents ($ file );
3. $ arr = explode ("\ n", $
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