What about MySQL mouth symbols?

Source: Internet
Author: User
How do I handle MySQL word symbols?
How do I handle MySQL word symbols?

The MySQL field is text, the word symbol will be automatically disconnected from here, the contents of the following cannot be put into storage. Using the Addslashes function is not valid.

The word symbol is the character that is finer than the mouth word, does not know whether it is garbled or cannot be displayed.
------to solve the idea----------------------
$s = ' 44cq6iup55czvevbteidtuwon+ibi+ ezvewpjemmipcfmyjwn5mi44cr5pys5p2l6yo96kab552h5lqg44cc56qb54s25p2l5lqg6io25y6f6jul55m955qe5y+n6aai8j+ Ygvcfmillpkfljyrlpjznmotvvizkvadov5norqnnvqtph4znmotnllfku6pnkibku6zmgi7kuyjmtlvwn5iz5y2b5lqu5asp55qe5pwi5p6c77ym5bcx5piv 6l+z5lmi54mb6yc84pym54wn6l+z5liq6lal5yq/5lil5y6777ym5lia5liq55ax56il5lin5q2i5asn5lia5liqy3vw5lqg5zcn8j+ysei/ mewwseayr+idtuwon+ibi+ezves4uuwvpei/mes5ioebq+eahoaev+aej++8gfcfkyrwn5gk5lia55ax56il5peg5pwi6yca5qy+ 77yb5bcx5piv5pyj5bqv5rcu4pymd2vpegluonn1bglumdkwoa== ';

$s = base64_decode ($s);
Echo $s, php_eol;
Preg_match_all ('/./u ', $s, $m);
Print_r ($m [0]);
Echo Bin2Hex ($m [0][13]);
f09f9988
This is a emoji emoji and needs to be set to UTF8MB4 to save
If your MySQL version is low and does not support UTF8MB4, you can change it by string substitution
Before warehousing
$text = Preg_replace_callback ('/[\xf0-\xf7].{ 3}/', function ($r) {return [email protected] '. Base64_encode ($r [0]);}, $text);

Get out of the library and change it back.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.