Problems with multibyte characters
There are mb_strlen() and mb_substr() for multibyte characters however there is no mb_str_word_count. Hence my previous post.
There are mb_strlen() and mb_substr() for multibyte characters however there is no mb_str_word_count. Hence my previous post.
Türkçe veya diğer özel -multibyte- karakterler için malesef PHP str_word_count(), strlen() gibi fonksiyonlarda yanlış sayım veriyor, her özel karakter 2 kelime / karakter sayılıyor. Bunu aşmak için iconv() transliteration da denedim ama kâr etmedi. Araştırmalarımda da tek -garanti- çözümün şüpheli karakterleri replace etmek olduğunu buldum ama her Türkçe karakteri (ve muhtemel diğer yabancı karakterleri) hardcode…
Always check for local time Despite the fact that my server timezone was set correctly, somehow time() was giving wrong ( UTC) hour. So i ended up using wp’s functions to make sure. $now = current_time( ‘timestamp’, 0 ) ;$local_ts = get_the_time(‘U’,$post->ID);
is_numeric doesnt check strings for numbers. You need to use preg_match(‘#[0-9]#’,$string)