There is no direct function for this in my knowledge. But it can be done easily like so.
“`php
if ( mb_strlen( $string, ‘ASCII’ ) === mb_strlen( $string, ‘utf-8’ ) ) {
return true;
}
“`
Category: Coding
unlearning the learnt
There is no direct function for this in my knowledge. But it can be done easily like so.
“`php
if ( mb_strlen( $string, ‘ASCII’ ) === mb_strlen( $string, ‘utf-8’ ) ) {
return true;
}
“`