What should I do if the php regular expression cannot be matched?

藏色散人
Release: 2023-03-09 19:30:01
Original
2203 people have browsed it

Solution to the problem that php cannot match the regular pattern: 1. Use the preg_match_all() function to obtain the regular matching content; 2. Output the matching content through print_r.

What should I do if the php regular expression cannot be matched?

The operating environment of this article: Windows7 system, PHP7.1 version, DELL G3 computer

Specific questions:

php正则匹配不到  为什么我这个一个也匹配不到呢?
Copy after login

Solution:

1. To obtain the content matched by the regular expression, you should use the preg_match_all() function

2. It is an array. Arrays cannot be output using echo. If echo outputs an array, it will only display Array

Copy after login

. Recommended study: "PHP Video Tutorial"

The above is the detailed content of What should I do if the php regular expression cannot be matched?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!