I should be how to match \xf0\x9f\x91\xab. Please help! How to write an expression??
Reply to discussion (solution)
$s = "\xf0\x9f\x91\xab"; Var_dump (Preg_match ('/\xf0\x9f\x91\xab/', $s));
$s = "\xf0\x9f\x91\xab"; Var_dump (Preg_match ('/\xf0\x9f\x91\xab/', $s));
Then you can only match one AH. This is just one of them.
$s = "\xf0\x9f\x91\xab"; Var_dump (Preg_match ('/\xf0\x9f\x91\xab/', $s));
Then you can only match one AH. This is just one of them.
Please post the need to match all the content!!
$s = "\xf0\x9f\x91\xab"; Var_dump (Preg_match ('/\xf0\x9f\x91\xab/', $s));
Then you can only match one AH. This is just one of them.
Please post the need to match all the content!!
Like this: Hello, \xf0\x9f\x98\x83 I am very \xf0\x9f\x86\x93 today. This binary is not deterministic.
If your string is utf-8, I am not mistaken, \xf0\x9f\x98\x83, etc. is a delimiter, the entire string should only have several forms, should be considered as a character (no word, only the placeholder, the role of separation)
If your string comes from an API, you might want to check out the documentation for this API.
I have said it in another post of yours, but your perception is too bad
Rule string:/\xf0.../
$s = "This is just the test text \xf0\x9f\x98\x83 in the program, in fact the emoji are \xf0\x9f\x86\x93 in the inner code. ";p reg_match_all ('/\xf0.../', $s, $r); foreach ($r [0] as $v) echo current (unpack (' h* ', $v)), Php_eol;
f09f9883
f09f8693
I have said it in another post of yours, but your perception is too bad
Rule string:/\xf0.../
$s = "This is just the test text \xf0\x9f\x98\x83 in the program, in fact the emoji are \xf0\x9f\x86\x93 in the inner code. ";p reg_match_all ('/\xf0.../', $s, $r); foreach ($r [0] as $v) echo current (unpack (' h* ', $v)), Php_eol;
f09f9883
f09f8693
Oh, I'm going to do this with your method.
$text = "This is just the test text \xf0\x9f\x98\x83 in the program, in fact the emoji are \xf0\x9f\x86\x93 in the inner code. ";//callback function call ($matches) { return" [Emoji] ". Bin2Hex ($matches [0])." [/emoji] ";} Echo preg_replace_callback ( "|\xf0...|", "call", $text);