Find occurences of unicode characters in string


Posted on 16th Feb 2014 07:03 pm by admin

I need to prohibit filenames with everything but English characters and numbers but regexp and string function don't seem to work because they consider the Greek alphabet letters as part of the A-Z a-z sequence. Here's what I've tried:

Quote:if (strspn($str, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") != strlen($str))
{
echo 'invalid filename';
}

Quote:if (!preg_match("/^([-a-z0-9])+$/i", $str))
{
echo 'invalid filename';
}

No comments posted yet

Your Answer:

Login to answer
316 Like 17 Dislike
Previous forums Next forums
Other forums

MS Exchange 2007 integration with ECC 6.0
Hello Experts,
We have ECC 6.0 and MS Exchange 2007. We need to integrate ECC 6 and MS Excha

Save data in input fields when they press "BACK BUTTON"
Hi, this is html form: And let's say they get a error "Please enter ur title must be more then

Coding Critique
I was hoping someone could take a second and look down my code and see if they see any problems with

str_replace help
Hey there,

I'm a PHP newb, I'm having troubles with the str_replace function. I want to clean

Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had

Send inserts to mysql thru port 80
Hi!

I have an application that must do some inserts in a mysql db. This db is behind a firewa

help with insert
Hi there,

I am trying to insert some data into a database, but for some reason, it is not ins

MySQL issue
I am taking sentences through a form on page. Then checking some condition and trying to insert them

Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased w

I need an iframe that calls up a different page according to the date
hi

I don't know any php (only html) and I urgently need to do the following:

I need a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash