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))
{
Did you know?Explore Trending and Topic pages for more stories like this.
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

Multiple submit forms inside a mysql array page
Hi all,

Im having trouble to get the beneath script to work the thing i can't seem to get wor

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

Creating a db with a query
Hello everyone.
I'm having troubles creating a db with a query.
I'm reading a book called PHP

php multiple action on submit
I have a form which says:

<form enctype='multipart/form-data' method='post' action='pr

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

Access database inside of a validation class
Hello,

For quite some time, I have been using functions to validate form input and access the

pull content
I have an existing page, domain/adverts.php which has a good PR. I've just rebuilt my site and the n

background color imagefill
Hello

I would like to ask you why I see this square in red color just in my local xampp insta

RadioButtonList data selection
view plaincopy to clipboardprint?

my login script page is not working on remote computers
hi my login is working on my computer, but when i tried 2 computers from 2 different locations, they

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