Php regular expression replacement
// 1. how to remove the "number" and the adjacent tag pair? remove this part in the following code:There are many other characters, forms, and so on... there are many other characters, forms, and so on.
$ Content = "0000111
222
There are many other characters, forms, and so on... there are many other characters, forms, and so on.
2221110000 "; // your image $ content =''; // $ content = preg_replace ('// is', '', $ content); var_dump ($ content );
Reply to discussion (solution)
1. echo preg_replace ('/<[^>] +> [^ <>] * [^ <>] * <[^>] +>/U ', '', $ content); 2, $ content = preg_replace ('/] +) src = [" \'] http [s]? : \ // Www \. aabbcc \. com \/upload \/qrcode_for_gh_2ff16e7c9789_258 \. jpg ["\ '] (. *?)> /Is ', '', $ content );
Moderator
1. echo preg_replace ('/<[^>] +> [^ <>] * [^ <>] * <[^>] +>/U ', '', $ content); 2, $ content = preg_replace ('/] +) src = [" \'] http [s]? : \ // Www \. aabbcc \. com \/upload \/qrcode_for_gh_2ff16e7c9789_258 \. jpg ["\ '] (. *?)> /Is ', '', $ content );
The result is empty...
Which one is empty?
Which one is empty?
$ Content = "0000111
222
There are many other characters, forms, and so on... there are many other characters, forms, and so on.
2221110000 "; $ content = preg_replace ('/<[^>] +> [^ <>] * [^ <>] * <[^>] +> /', '', $ content); // remove the modifier.
Which one is empty?
Scan the QR code or search for the mcq28tui.
<[^>] +> [^ <>] * [^ <>] * <[^>] +> The matched result is
Or directly search for the number:
How does one match the span tag (the closest tag to the ID )?