If there ever comes a time when you wish to detect whether a string has english characters or not... There is a very simple way of representing this in PHP. Here is a PHP function which will return true if the string contains english characters or it will return false if there are foreign characters.

function is_english($str)
	if (strlen($str) != strlen(utf8_decode($str))) {
		return false;
	} else {
		return true;

So, if you were to pass the function:


You would receive back a true value. Alternatively if you were to call this function as the following:


You will most likely receive a false value.


or Sign Up

Sign Up

or Login
Cheers Friend!

I'm Tony, the creator of this site. I'm trying to increase my twitter following. Want to follow me?

Follow @tnylea If not, no worries :)