casesscriptstringstherefunction

A softwarerating -directory

Demo search...   

Menu


Play me


Play!

Nice software sites


Settings

Font [] :  
Gamma : Light
Language : Russian

My link

text link:


button:


... / Forum / Web development / PHP :

UTF-8 Hack





Wolf [ Admin | Message: 31 | Registered: 28 November 2006 | Website | E-mail ]
On Saturday, 6 January 2007 [10:14]
Left message

There some programs in this site, PAD of which contains non-UTF characters by reasons - I not got. And my default text processing script returns empty strings in such cases. So I come to question - how to determine these incorrect strings and not process them. Solution is very easy:

Код
function is_utf ($t)
{
 if ( @preg_match ('/.+/u', $t) )
  return 1;
}

This function will return true only if string type is valid in other cases one crashes but as its presided (is it right word?) with "@" - there's no crash reports in script.

On Saturday, 6 January 2007 [10:16] Admin edited this message



Nickname:
Password:
E-mail:  Get the password
ICQ:
Website [URL]:
Signature: [300]
Subscribe:
Advice: If you already registered - nickname + password will be enough to identify you

Message: [5000]

Citation Super-Citation Code Shady text :) :( ;) :D =) =( :o =o 8)) 8(




Wolf's Ware 2004-2008 © Wolf