javascript - how to get character's length which encoding with utf8mb4 in php and js -


i use mysql support utf8mb4 store emoji, in php or js side, can not correct length of them function of textarea input maxlength.

as far know, utf8mb4 not support php or web side. know how make it?

i js solve in js side ,which supported twitter! see twitter-text-js

but how make in php side, don't find new twitter-text-php? find answer, how use it?

  • js twitter-text-js

    var tweet = "👌h饿1"; var remainingcharacters = twttr.txt.gettweetlength(tweet);

  • php

    mb_strlen


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -