This article mainly introduces the support of Chinese and other coded PHP intercept string Function example (intercept Chinese strings), the need for friends can refer to the following
Simple string interception method, support the Chinese and other
Just tested a PHP Web page, the results found that the title of Chinese garbled, so, search has been a relatively good answer
In
Add the following sentence in front of the label to resolve
Copy the Code code as follows:
http://www.bkjia.
Copy CodeThe code is as follows:
/**
*
* Statistics software and articles, such as month, week, day ranking
*
* $field _id (article ID)
*/
The method of counting month, week and day ranking
Require_once (DirName (__file__). " /..
Copy CodeThe code is as follows:
$filename =date ("Y year M D Day"). " Data information statistics results. xls "; Filename
$ua = $_server["Http_user_agent"]; Chinese file name is not garbled
if (Preg_match ("/msie/", $ua)) {
$filename =urlencode
Mapping The function of the main is the actual Internet access to the current mapping of the computer, first we have to do the router port mapping, the common open port has 80,21,3389, etc., 80 is the site common port, 21 is the FTP server common
Sometimes we need to do some task at some time of the day, or different tasks in different hours of the day, how to do it with PHP, the following two examples can solve this problem
The judgment code containing hours and minutes is as follows:
Someone with a certain understanding of the PHP kernel should know that the essence of PHP is that hashtable,hashtable is ubiquitous in PHP implementations. Including the PHP array, what global variables, the scope of local variables, and so on, PHP
The Call_user_func function is used when you need to invoke a function dynamically, and this function has two uses:
The first is to invoke the solitary function:
Copy CodeThe code is as follows:
function Funa ($b, $c)
{
Echo $b;
Echo
English:
The code is as follows
function Tourl ($STR) {$str = preg_replace ('/[^a-za-z0-9]+/', '-', $str);$str = Trim ($str, '-');Return Strtolower ($STR);}
Contains special characters:
code as
This involves the bottom of the system, Web development is almost useless, know that the next thing is good. The underlying interpretation of things is always simple.
Variables are stored in memory as binary digits. Integers are 4 bytes on 32-bit
In PHP, if you use a session to determine whether a user is logged in or not, you can do so when you exit:
Session_Start ();Session_destroy ();
The session indicates that it has ended. The next sentence should be written JS, so that the page
today encountered a Getjson problem, the callback function has been unable to execute, check the format of the generated JSON data absolutely no problem, Getjson JS syntax is no problem, but the alert does not come back to the data. It was Phpcms's
Personal Hobby, researched the YII framework under PHP.
First, the premise of studying the YII framework is to download PHP's one-click Installation and Zend Studio. PHP One-click installation gives the following
By understanding Appserv more suitable for beginners to quickly build a Web server environment, development php! Let's start with the Appserv!
Appserv is a PHP Web station tool combination package, the author will be some network of free station
This article mainly introduces the PHP implementation of the rapid sequencing of three methods, three methods have advantages and disadvantages, the need for friends can refer to the following
Wrote three examples of PHP quick row, the first
Weibo speech has the word limit, its counting way is, Chinese count 2, English count 1, full-width character count 2, half-width character count 1.
PHP comes with strlen is the number of bytes returned, for UTF8 encoded in Chinese returns 3, does
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