PHP Parsing Emoticons

Source: Internet
Author: User
PHP Parsing Emoticons
  1. $face =array ("Smile" and "0_ smile. gif"), Array ("Pie Mouth" and "1_ pie mouth. gif"), Array ("Color" and "2_ color. gif"), Array ("daze" = "3_" In a daze. gif "), Array (" Proud "and" 4_ "), Array (" Tears "=" 5_ tears. gif "), Array (" shy "=" 6_ shy. gif "), Array (" Shut up "=" 7_ Shut up. gif "), Array (" Crying "and" 9_ "), Array (" embarrassed "=" 10_ awkward. gif "), Array (" Cross "=" 11_ angry. gif "), Array (" naughty "=" 12 _ Naughty. gif "), Array (" grin "and" 13_ grin teeth. gif "), Array (" surprise "=" 14_ surprised. gif "), Array (" sad "=" 15_ sad. gif "), Array (" Cool "+" 16_. gif "), Array (" sweat "=" 17_ "and" 18_ "), Array (" Spit "and" 19_ "), Array (" laugh "and" = ")," 20_ laughed. gif "), Array (" cute "=" 21_ cute. gif "), Array (" Eye "and" 22_ "), Array (" arrogant "=" 23_ arrogant. gif "), Array (" Hunger "= > "24_ hungry. gif"), Array ("Sleepy" = "25_"), Array ("panic" = "26_ panic. gif"), Array ("sweat" = "27_ sweat. gif"), Array ("Hanxiao" = > "28_ hanxiao. gif"), Array ("Soldier" and "29_"), Array ("struggle" = "30_ struggle. gif"), Array ("curse" = "31_ curse. gif"), Array ("question "= =" 32_ question. gif "), Array (" Boo "and" 33_ "), Array (" halo "=" 34_ halo. gif "), Array (" torture "=" 35_ torture. gif "), Array (" decay "= > "36_. gif"), arrAy ("skeleton" = "37_ skeleton. gif"), Array ("Beat" = "38_"), Array ("Good-Bye" and "39_-bye. gif"), Array ("Wipe the sweat" and "40_ wipe the sweat. gif"), Array ("Key nose" and "41_"), Array ("Applause" = "42_ clap. gif"), Array ("embarrassed" = "43_"), Array ("bad laugh" = "44_ Bad laugh. gif "), Array (" left hem "= =" 45_ left hem. gif "), Array (" right hem "=" 46_ right hem. gif "), Array (" yawn "=" 47_ yawn. gif "), Array (" despise "= > "48_ despise. gif"), Array ("Grievance" and "49_"), Array ("fast cry" = "=" 50_ fast cry. gif "), Array (" sinister "=" 51_ sinister. gif "), Array (" Kiss "=" and "52_ kiss. gif"), Array ("Scare" and "53_"), Array ("poor" = "54_ poor. gif"), Array ("Chopper" = "55_ chopper. gif"), Array (" Watermelon "=" 56_ watermelon. gif "), Array (" Beer "=" 57_ beer. gif "), Array (" basketball "=" 58_ basketball. gif "), Array (" ping pong "=" 59_ ping pong. gif "), array ("Hug" = "78_ hug. gif"), Array ("handshake" = "81_ handshake. gif"), Array ("smile proudly" = "smile proudly. gif"), Array ("Listen to music" = "listen to music. gif"));
  2. foreach ($face as $k = = $item) {
  3. $a =array_keys ($item);
  4. $b []= ' ['. $a [0]. '] ';
  5. }
  6. $GLOBALS [' Qqface_maps ']=array_values ($b);
  7. function qqface_convert_html ($text) {
  8. return Str_replace ($GLOBALS [' Qqface_maps '],
  9. Array_map ("Add_img_label", Str_replace (Array (' [', '] '), ', Array_values ($GLOBALS [' qqface_maps '])),
  10. Htmlspecialchars_decode ($text, Ent_quotes)
  11. );
  12. }
  13. function Add_img_label ($v) {
  14. Return ';
  15. }
  16. echo qqface_convert_html (' sdf[eyes]sdfs[crazy [cute] ');
Copy Code
Php
  • 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.