The Str_replace () function replaces some characters in a string with other characters (case-sensitive).
The function must adhere to the following rules:
If the searched string is an array, it returns the array.
If the searched string is an
PHP's own function of intercepting strings can only handle English, the number can not intercept the Chinese mixed, the following example is more useful, the first is mainly for beginners to learn to use, the specific code is as follows:
". $str. "
The In_array () function searches the array for the presence of the specified value. Returns TRUE if the value is found in the array, otherwise FALSE.
This article mainly introduces the usage of In_array function in PHP, and probes into the usage
Static is the definition of a static object or a static variable, and what are the characteristics of a variable or class method that is defined by static? We've seen the relevant examples of this article.
1. Create the object $object = new Class (),
Sometimes when we do the development of the program, want to know how long the user in the Site page browsing, then how to achieve this function?
This article mainly introduces the PHP record page dwell time method, involving PHP with JS for file
The use of the technology to effectively support a large number of fine-grained objects, the need for friends can refer to.
Enjoy meta-mode English is called "Flyweight pattern", I am very grateful to the Flyweight pattern translated into the model
e-mail, like a regular email-like, also requires an address, which differs from regular mail in that it is an electronic address. All users who have mailboxes on the Internet have one or several email addresses, and these email addresses are unique.
Objective
Finally, to talk about this famous design principle, in fact, it is simpler than other design patterns.The essence of dependency injection is to separate the parts and replaceable parts of a class that cannot be replaced, and to use them
A simple way to combine CSS layout pages:
DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">HTMLxmlns= "http://www.w3.org/1999/xhtml">Head>Metahttp-equiv= "Content-type"content=
This article mainly introduces the PHP implementation of the judgment array is one-dimensional, two-dimensional or several-dimensional method, involving PHP recursive operation and array-related judgment skills, the need for friends can refer to the
Query function is often used in the daily development, today we PHP Chinese network with you to comb the query function implementation method, as well as a brief introduction of how to use the query function in thinkphp. SQL match mode 1. Use SQL
Binary search also known as binary lookup, the advantages are less than the number of comparisons, Find Fast, the average performance is good, the disadvantage is that the unknown origin table is ordered table, and insert delete difficult. Therefore,
When doing the site, use a server tool cutycapt, on the server can be directly crawled with commands, generate a picture of the specified URL. However, when executing a system command in PHP, it is found that the command
The SimpleXML function allows you to convert XML to an object through a commonProperty Selector
or an array iterator that can handle this object just like any other object. Some of these functions require the latest version of PHP.
Installation:
Today's Internet, the collection of Web sites are very many, many sites like hotlinking/misappropriation of other people's website pictures, so not only violated the network rights, but also caused by the hotlinking of the site consumes a lot of
1. deleting files
Unlink ()
Syntax: int unlink (string filename);
return value: Integer
Function type: file access. Such as:
Unlink ("Tmp/test.txt");
PHP reads the file by line to remove the line break "\ n":
$content =str_replace ("\ n", "",
code for crawling Remote Web site data by PHP
Now there may be a lot of program enthusiasts will encounter the same question, is how to crawl other people's Web site HTML code, like a search engine, and then collect the code into their own useful
MySQL transaction is mainly used to deal with large-scale and high-complexity data. For example, in the Personnel Management system, you delete a person, you need to delete the basic information of the person, but also to delete the information
function Pinyin ($_string, $_code= ' UTF8 ') {//GBK page can be changed to gb2312, other random fill as UTF8
$_datakey = "A|ai|an|ang|ao|ba|bai|ban|bang|bao|bei|ben|beng|bi|bian|biao|bie|bin|bing|bo|bu|ca|cai|can|cang|cao |ce|ceng|cha ".
"|chai|chan|
Phpcms Configure the list page and get the article published time, no nonsense to say, directly to everyone to paste the code, the specific code is as follows:
{pc:content action= "lists" catid= "one" order= "id DESC" num= "Ten" moreinfo= "1"}
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