After PHP is upgraded to php5.3, some programs often find the function eregi () is deprecated error message.Why?This is because the eregi () function is no longer supported in php5.3 and is replaced by the preg_match () function.The solution is to
After PHP is upgraded to 5.3,ProgramThe error "function split () is deprecated" is returned.This is because of various reasons (mainly for the reason of regular expressions, see below for details). The split function is not supported in the new
Ereg ()Ereg_replace ()Eregi ()Eregi_replace ()Split ()(1) Ereg,eregiThis is a regular expression matching function, the former is case-insensitive, and the latter is irrelevant.Usage:Ereg (regular expression, string, [match part array name]);Regular
PHP string regular expression replacement function preg_replace. Syntax: mixedpreg_replace (mixedpattern, mixedreplacement, mixedsubject); return value: mixed type data function type: data processing content description: This function uses pattern
Syntax: Mixed preg_replace (mixed pattern, mixed replacement, mixed subject);
Return value: Mixed type data
Function type: Data processing
Description: This function parses the subject string with the rule of pattern, and the string to be replaced
Syntax: mixed preg_replace (mixed pattern, mixed replacement, mixed subject );Returned value: Hybrid DataFunction type: data processingDescription: This function uses the pattern rule to parse and compare the string subject. The string to be
Use the PHP string regular expression replacement function preg_replace. 1. preg_replace () $ msgpreg_replace (style. + styleis, $ msg); ----- delete stylestyle and the middle part $ msgpreg_replace ([^] +, $ msg); ----- is the delete and inner
1.
PHP string Regular replacement function Preg_replace Use instructions, the need for friends can refer to the next.
1. Preg_replace ()
$msg = Preg_replace ("/ and the middle part $msg = Preg_replace ("/]+>/", "", $msg); -----is to delete <> and
PHP regular expression syntax reprinted from: http://blog.csdn.net/kkobebryant/article/details/267527
Basic regular expression syntax
First, let's take a look at two special characters: '^' and '$'. they are used to match the start and end of the
: This article mainly introduces the PHP regular expression syntax summary. if you are interested in the PHP Tutorial, you can refer to it. Http://bbs.chinaunix.net/forum.php? Mod = viewthread & tid = 4101636.
Use well
Regular expressionPHP is often
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.