Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7536485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:35:12+00:00 2026-05-30T06:35:12+00:00

when I send form and check for the arabic and english and numeric chars

  • 0

when I send form and check for the arabic and english and numeric chars the code below not working :

<?
$username = $_POST["alalala"];
if ($username){
if (!preg_match("/^[a-zA-Z0-9ا-ي ]+$/i", $username)){
echo "error";
}else{
echo "ok";
}  
}
?>
<form method="post">
<input type="text" name="alalala">

the regex can’t find arabic in $_post[alalala]

EDIT

not working :s, the problem not in p{Arabic}

it’s in finding the arabic chars only when form submit

EDIT2 : when i change the line

$username = $_POST["alalala"];

to

$username = "any thing نستيتيلا";

the regex find the arabic chars

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:35:13+00:00Added an answer on May 30, 2026 at 6:35 am

    try https://stackoverflow.com/a/3631408/731179

    <?php 
    preg_match("/^[a-zA-Z\p{Arabic}0-9\s\-]+$/u", "whatever"); 
    ?>
    

    PHP supports PCRE

    http://fi.php.net/manual/en/function.preg-match.php#105324
    http://fi.php.net/manual/en/regexp.reference.unicode.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a code to send a Form Post with login credentials to a
Is it possible to get username and password from windows form and send them
Ive been working on create a file upload form using PHPmailer to send as
I created a sample form and code below to illustrate. I know i can
I have form inputs to send to another page to check on and validate
I send form data using php in colorbox(lightbox) ifarme method. so i close auto
I'm trying to send form fields and file to a web service using php
If you use POST to send FORM data to a PHP page, are the
I am getting a FaultEvent when trying to send form fields through HTTPService that
We are using C#, ASP.NET & WCF. I am trying to send form data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.