Solve, thank you.
Reply to discussion (solution)
Old, Donald, and so on, can't pass the old word.
The rules are: $pre = '/old/';
Preg_match returns the number of matches to 0 or 1, which only performs a match once
'/[\'\"\ \ ]/'
This rule is to find, single quotation marks, double quotes, half space, full-width space, these four sets, as long as there is any one, do not pass, in addition to the single quotation mark to add \ Escape, the other can not add
Specify the encoding
$pre = '/[\ ' \ ' \ \]/u ';
$str = ' Donald Duck '; $pre = '/[\ ' \ \ \]/', if (Preg_match ($pre, $str)) { echo $str. ' Not passed ';} else{ echo $str. ' Through ';}
Donald Duck Through
$str = ' Donald Duck '; $pre = '/[\ ' \ \ \]/', if (Preg_match ($pre, $str)) { echo $str. ' Not passed ';} else{ echo $str. ' Through ';}
Donald doesn't pass.
I don't know what you're going to do.
$str = ' Donald Duck '; $pre = '/[\ ' \ \ \]/', if (Preg_match ($pre, $str)) { echo $str. ' Not passed ';} else{ echo $str. ' Through ';}
Donald Duck Through
$str = ' Donald Duck '; $pre = '/[\ ' \ \ \]/', if (Preg_match ($pre, $str)) { echo $str. ' Not passed ';} else{ echo $str. ' Through ';}
Donald doesn't pass.
I don't know what you're going to do.
Sorry, my question is not clearly expressed.
is to detect whether the $STR string contains the single quotation marks in the $pre, and so on, the expression does not pass, does not pass.
For example: $str = ' Hello ' can be passed
$str = ' Hello ' there is no space between the two words.
But I found $str= ' Donald Duck ' or $str= ' old ' couldn't pass, and two didn't contain half-width white space full-width single quotation marks, very strange why?
Thank you.
Old, Donald, and so on, can't pass the old word.
The rules are: $pre = '/old/';
Preg_match returns the number of matches to 0 or 1, which only performs a match once
'/[\'\"\ \ ]/'
This rule is to find, single quotation marks, double quotes, half space, full-width space, these four sets, as long as there is any one, do not pass, in addition to the single quotation mark to add \ Escape, the other can not add
Sorry, my question is not clearly expressed.
is to detect whether the $STR string contains the single quotation marks in the $pre, and so on, the expression does not pass, does not pass.
For example: $str = ' Hello ' can be passed
$str = ' Hello ' there is no space between the two words.
But I found $str= ' Donald Duck ' or $str= ' old ' couldn't pass, and two didn't contain half-width white space full-width single quotation marks, very strange why?
Thank you.
No, what's wrong with my two test results?
No, what's wrong with my two test results?
I didn't get the first one here, and I don't know why.
No, what's wrong with my two test results?
I didn't get the first one here, and I don't know why.
Remove the full-width space in the $pre to
#2 should have been said, Utf-8 code to add a U property
No, what's wrong with my two test results?
I didn't get the first one here, and I don't know why.
#2 should have been said, Utf-8 code to add a U property
No, what's wrong with my two test results?
I didn't get the first one here, and I don't know why.
Okay thank you
Specify the encoding
$pre = '/[\ ' \ ' \ \]/u ';
Thank you
If I solve this, do not want to use regular ~ to provide a way of thinking under discussion
Code rough not tested, there are errors please forgive
$str = ' Tang Lao ' duck '; $search = Array (', ', '); The character to be detected $replace = '; Disable the word embox into spaces $str = Str_replace ($search, $replace, $str), if (Strpos ($str, ')!== false) {//To determine if there is no space Echo ' does not pass ';}
Leaving the editor is true to the colours