What makes people click?

Last week I added Google analytics to elephpants.com just to see what kind of a response it would get.

The site has no content, other than a lovely picture of Elefina, and as far as I know it’s only linked from this blog, although I only added that link a couple of days ago.

Already the site has had hits from Malaysia (Kuala Lumpur), Brazil (Rio de Janeiro), the US (Mountain View, California) and Germany (Bonn).

Google analytics tells me that one person came as a click from this site, and three from Google after a search for “Elephpants” – which kinda makes sense.

If you are responsible for any of those clicks, please do let me know – as I am intrigued as to what makes people “click”.

UTF-8 and strlen()

Trying to find out the length of a string and wondering why the values are often wrong?

UTF-8 characters can be multi-byte, and strlen() returns the length of the string in bytes, which means the string ååå would actually have a “length” of 6.

One solution is to use the multibyte function “mb_strlen” instead, you will need to have PHP compiled with this – but it seems to be a default in later versions.

E.g.

$value = "ÅØÆbob";
echo strlen($value);
// 9
 
echo mb_strlen($value, 'UTF-8');
// 6