In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Most people do not understand the knowledge points of this article "php how to regularly remove double quotes from strings", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "php how to regularly remove strings in double quotes" article.
In PHP, you can use the "preg_replace" function and "/ (\") / "regular expression to remove double quotes from a string, which is used to perform the search and replacement of a regular expression with the syntax of" preg_replace ('/ (\ ") /',', string)".
Operating environment of this tutorial: windows10 system, PHP7.1 version, DELL G3 computer
How to remove double quotation marks from a string by php
The preg_replace function performs the search and replacement of a regular expression.
Grammar
Mixed preg_replace (mixed $pattern, mixed $replacement, mixed $subject [, int $limit =-1 [, int & $count]])
Search for parts of subject that match pattern and replace them with replacement.
Parameter description:
Pattern: the pattern to search for, which can be a string or an array of strings.
Replacement: the string or array of strings used for replacement.
Subject: the target string or array of strings to search for replacement.
$limit: optionally, the maximum number of replaceable times per subject string for each pattern. The default is-1 (unlimited).
$count: optional, the number of times the replacement is executed.
Return value
If subject is an array, preg_replace () returns an array and in other cases a string.
If the match is found, the replaced subject is returned, and in other cases, the unchanged subject is returned. If an error occurs, return NULL.
First of all, we need to write the reg='/ that matches the double quotation marks. You must understand that the double quotation marks are a special character, and the special characters need to be escaped according to the regular rules, so we get the regular $quotation (\ ") /'.
Examples are as follows:
Output result:
The above is about the content of this article on "how to regularly remove double quotes from a string by php". I believe we all have some understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.