Four Chinese character string truncation functions in php
// Truncate a Chinese string
Function mysubstr ($ str, $ start, $ len ){
$ Tmpstr = "";
$ Strlen = $ start + $ len;
For ($ I = 0; $ I
Php-written class for filtering and retaining attributes
/**
@ Set and retain the attribute class
@ Class cleanHtml
@ Link: bbs.it-home.org
@ Date: 2013/2/28
*/
Function reg_escape ($
Php Chinese string truncation (mb_substr) instance
$ Str = 'script School: http://bbs.it-home.org ';
Echo mb_substr ($ str, 'utf-8'); // capture the first five characters. assume that the php file where the code
Php obtains the ID code of all sublevels and grandchildren of a topic.
/***
@ Obtain the subtopic ID
@ Bbs.it-home.org
@ 2013/2/26
*/
Private function sonCategoryIds ($ categoryID)
Php code for generating a password of the specified length (text)
I wrote a function to generate a password with a specified length. if you need a password, refer. The $ strength parameter is used to determine the format of the password
Solution to InvalidcommandRewriteEngine error in zf
Zend framework tutorial: run The example and report The following error: The server encountered an internal error and was unable to complete your request. either the server is
Phpdirname (_ FILE __)
Assume that the current file is stored in (d: \ www \) and the file name is test. php.Assume that the current file is stored in (d: \ www \) and the file name is test. php. The code is as follows:
Note: The
Check whether the php file has bom header code
// This file is used to quickly test whether the UTF-8 encoded file is added with BOM and can be automatically removed.
// By Bob Shen
$ Basedir = "."; /
A problem encountered when uploading php files (move_uploaded_file)
When uploading a php file, you cannot use the move_uploaded_file function to move the file, but you can use copy or rename.When uploading a php file, you cannot use the
Php error: Cannotsendsessioncookie-headersalreadysentby solution
UTF-8 EF BB BF
UTF-16 Big Endian FE FF
Little Endian ff fe UTF-16
UTF-32 Big Endian 00 00 FE FF
UTF-32 Little Endian ff fe 00
Example of removing duplicate values from a phparray_unique one-dimensional array
/**
* Remove repeated elements from the array
* Link: bbs.it-home.org
* Date:
*/
$ Input = array
Php class for using PDO to operate databases (applicable to Mysql)
/*** 作者:胡睿* 日期:2012/07/21* 电邮:hooray0905@foxmail.com*/class HRDB{protected $pdo;protected $res;protected $config;/*构造函数*/function __construct($
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