Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to remove Chinese colons by php

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article "php how to remove Chinese colon" article knowledge point most people do not understand, so small editor to give you a summary of the following content, detailed content, clear steps, with a certain reference value, I hope you can read this article to gain something, let's take a look at this article "php how to remove Chinese colon" article bar.

In php, you can remove the Chinese colon by using the "preg_replace()" function, which is used to perform a search and replacement of a regular expression. When the parameter is set to "'/:/',"you can remove the Chinese colon. The syntax is"preg_replace ('/:/','$str)".

Operating environment: Windows 10 system, PHP 7.1 version, Dell G3 computer.

php how to remove Chinese colon

The preg_replace function performs a search and replace of a regular expression.

syntax

mixed preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] )

Search for parts of the subject that match the pattern and replace them with replacement.

Parameter Description:

$pattern: The pattern to search for, either a string or an array of strings.

$replacement: String or array of strings used for replacement.

$subject: The target string or array of strings to search for replacement.

$limit: Optional, maximum number of substitutions for each subject string for each pattern. The default is-1 (unlimited).

$count: optional, is the number of times the substitution is performed.

return value

If subject is an array, preg_replace() returns an array, otherwise a string.

If a match is found, the replaced subject is returned, otherwise the unchanged subject is returned. If an error occurs, NULL is returned.

Examples are as follows:

Output:

The above is about "php how to remove the Chinese colon" this article content, I believe everyone has a certain understanding, I hope the content shared by Xiaobian is helpful to everyone, if you want to know more related knowledge content, please pay attention to 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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report