The usage of the constant DIRECTORY_SEPARATOR in php is deeply analyzed. The usage of the constant DIRECTORY_SEPARATOR in php is deeply analyzed. This document describes the usage of the constant DIRECTORY_SEPARATOR in php. Share it with you for
The Array_search () function searches the array for the given value, returns a key value after it is found, or returns false. Before PHP 4.2.0, the function returned null instead of false on failure. The syntax format is as follows mixed
PHP Chinese word segmentation-jerrylsxu's most common word segmentation:
$str = 'This is my website www.7di.net! '; //$str = iconv('GB2312','UTF-8',$str); $result = spStr($str); print_r($result); /** * UTF-8 Chinese binary word
Directory_separator is a command that displays the system delimiter, Directory_separator is the internal constant of PHP and is not required to be used for any definition or inclusion.
As we all know, under the Windows path separator is (of course,
& Nbsp; exceptions often occur in the HTML format during character truncation. ASP is, PHP is, too. if it is a foreseeable simple HTML format, use replace, the article body may contain all HTML formats. to be efficient, use the following: Tested & #3
PHP Search Array Strings We typically use Array_search and In_array two functions
array_search() function in_array() , look for a key value in the array. If the value is found, the key name of the matching element is returned. Returns False if it
Small functions that remove HTML tags and javascript code
Function trip_html ($ html, $ len ){
// $ Html should contain an HTML document.
// In this example, the HTML tag and javascript code are removed.
finding strings is the primary application of regular expressions. In PHP, the two functions that are available and used to match POSIX-style regular expressions are the Ereg () function and the eregi () function.
Ereg () function and eregi ()
Searching strings is the main application of regular expressions. In PHP, the two functions that can be used to match POSIX regular expressions are ereg () and eregi. The syntax format of ereg () and eregi () functions is as follows: finding strings
For example, if the network address we provide is httt: wwwphpfensicom, but we can use the following program to automatically add a super connection to it: functionautolink ($ foo) {$ fooeregi_replac
If we provide the network address httt: //
Modify XML to specify label contents (I'm a space that removes the specified label content)
In fact, it is a very simple method, the need for the pot friends to take directly.
Test.xml
XML version= "1.0" encoding=
Filter HTML tags in PHP can have built-in functions, but it filtered too clean, we sorted out some use the regular to filter the specified HTML tag example, as shown below.
Sometimes it is necessary to filter out the extra tag attributes, such as
If the application directory is yiidemo, then cdyiidemoyiicwebappdemo (the application name) will generate framework 2 to create contro PHP framework YII note 1.
1. install yiicin the architecture, and put the yiicand php.exe under frameworkin the
PHP Template Parsing class
Class Template {
Private $vars = Array ();
Private $conf = ';
Private $TPL _name = ' index ';//If the template does not exist, it will find the current Controller default index
This article introduces the three functions Strtr, Str_replace and Preg_replace, which are used in PHP for string processing, in the comparative analysis of efficiency. If you need a friend, refer to it.Below compare the efficiency of STRTR,
This time to bring you the PHP array function array_unique () to remove duplicate values in the array, the PHP array function array_unique () to remove the array of repeating values of attention to what, the following is the actual case, together to
Php template parsing class
-->
$velocityCount-->
-->
1. [PHP] code
TVal = array ();}/*** set the template file directory * @ param string $ dir */public function setTemplateDir ($ dir) {$ this-> tDir = $ dir;}/*** whether to compile in real time
Php clears html functions generated by word
When you use FCKedior or ueditor, the content pasted from word will generate many additional tags. This article will share a function to clear this extra html code, for more information, see.Note:
This article mainly introduces the usage of the constant DIRECTORY_SEPARATOR in php, which involves some practical value for situations where Linux path separators are not supported, for more information about the usage of the constant
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.