Let us create a Santali Pangram Checker | Build a Santali Pangram Checker Using PHP: A Beginner-Friendly Tutorial

 

 

Have you ever wondered whether a single Santali sentence can contain all 30 letters of the Ol Chiki script?

Imagine you are a teacher who wants to check whether students have learned every letter of the Santali alphabet. Instead of checking every letter manually, you could create a small computer program that does the work for you.

In this tutorial, we will learn how to build a Santali Pangram Checker using PHP. We will understand every part of the code, learn how the computer searches for letters, and discover how HTML and PHP work together to create a simple web application. A pangram is a sentence that uses every letter of the alphabet at least once. In English, “The quick brown fox jumps over the lazy dog” is the classic example. But what about Santali?

The below text is a Santali Pangram (text was taken from Santali Wikipedia):

ᱟᱡ ᱫᱚ ᱟᱡᱟᱜ ᱚᱞ ᱪᱤᱠᱤ ᱵᱮᱱᱟᱣ ᱥᱟᱶ ᱥᱟᱶᱛᱮ ᱟᱹᱰᱤ ᱜᱟᱱ ᱯᱚᱛᱚᱵ ᱯᱩᱛᱷᱤ, ᱥᱮᱨᱮᱧ ᱟᱨ ᱜᱟᱭᱟᱱ ᱯᱩᱛᱷᱤ ᱮᱢᱟᱱ ᱠᱚ ᱚᱞ ᱠᱷᱟᱹᱛᱤᱨ ᱦᱚᱸ ᱟᱹᱰᱤ ᱜᱟᱺᱦᱤᱨ ᱩᱯᱨᱩᱢ ᱡᱮᱜᱮᱛ ᱡᱟᱠᱟᱛ ᱨᱮ ᱢᱮᱱᱟᱜ ᱛᱟᱭᱟ ᱾ ᱩᱱᱤ ᱫᱚ ᱑᱕ ᱜᱚᱴᱟᱝ ᱜᱟᱱ ᱯᱚᱛᱚᱵ ᱮ ᱥᱳᱸᱯᱟᱫᱚᱠ ᱞᱮᱫᱼᱟ ᱾ ᱚᱱᱟ ᱠᱷᱚᱱ ᱫᱚ ᱦᱤᱛᱟᱹᱞ ᱵᱟᱹᱲᱛᱤ ᱦᱚᱲ ᱠᱚ ᱠᱩᱥᱤᱭᱟᱜᱼᱟ, ᱡᱟᱦᱟᱸ ᱥᱟᱱᱛᱟᱲ ᱥᱟᱶᱛᱟ ᱨᱮ ᱥᱟᱱᱛᱟᱲ "ᱫᱷᱚᱨᱚᱢ ᱯᱩᱛᱷᱤ" ᱢᱮᱱᱛᱮ ᱢᱟᱱᱟᱣ ᱵᱟᱛᱟᱣ ᱢᱮᱱᱟᱜᱼᱟ ᱾ ᱥᱟᱬᱮᱥ ᱨᱤᱱ ᱾ 
 

You do not need to be an experienced programmer. If you can type a sentence, follow instructions, and experiment with examples, you can get started!

I have hosted it in hathiyar website, go check it out (paste the above Santali sentence in the Hathiyar website). So, now let'us understand this simple PHP script . 

1. What is a pangram?

A pangram is a sentence that contains every letter of a particular alphabet at least once.

For example, in English, the sentence “The quick brown fox jumps over the lazy dog” is a well-known pangram because it contains all 26 English letters.

Our goal is to apply a similar idea to Santali written in Ol Chiki.

The program checks whether the sentence contains each of the 30 letters in our predefined Ol Chiki list.

An everyday analogy: checking attendance

Imagine a classroom with 30 students. Each student represents one Ol Chiki letter.

The teacher has a checklist containing all 30 names. When a student arrives, the teacher marks that student's name.

At the end of the day:

  • If all 30 students are present, the attendance is complete.

  • If some students are absent, the teacher identifies their names.

Our PHP program does the same thing, except it checks letters in a sentence instead of students in a classroom.

2. What do we need?

Before writing the program, let us understand the tools.

Technology What it does
HTML Creates the webpage structure, including the text box and button.
PHP Checks the sentence and determines which letters are missing.
Unicode Allows computers to represent characters from Ol Chiki and many other writing systems.
UTF-8 An encoding that allows the webpage to handle Ol Chiki characters correctly.

You need a text editor and a PHP-enabled environment. For example, you can use Visual Studio Code or Notepad++ to edit the file, and XAMPP or PHP's built-in development server to run it.

Important: PHP code must run through a PHP server. Opening the file directly as a local HTML document will not execute the PHP instructions.

3. Understanding the complete code

Let us divide the program into small pieces. Think of the whole program as a machine with three stages:

  1. Collect the sentence.

  2. Check the letters.

  3. Display the result.

Step 1: Start the PHP program

<?php

This opening tag tells the server that PHP code begins here.

Think of it as opening a toolbox. Everything written in PHP syntax inside the opening and closing tags can be interpreted as PHP instructions.

Later in the program, you will see ?>. That closing tag tells PHP that this section has ended and ordinary HTML can follow.

Step 2: Create the Ol Chiki alphabet list

// Santali Ol Chiki alphabet (30 letters)
$olChiki = [
    "ᱚ","ᱛ","ᱜ","ᱝ","ᱞ","ᱟ","ᱠ","ᱡ","ᱢ","ᱣ",
    "ᱤ","ᱥ","ᱦ","ᱧ","ᱨ","ᱩ","ᱪ","ᱫ","ᱬ","ᱭ",
    "ᱮ","ᱯ","ᱰ","ᱱ","ᱲ","ᱳ","ᱴ","ᱵ","ᱶ","ᱷ"
];

This is one of the most important parts of the program.

The first line begins with //. In PHP, two forward slashes introduce a single-line comment. A comment explains the code to humans; PHP does not execute it.

Next comes:

$olChiki = [

The dollar sign $ indicates a PHP variable. A variable is like a labeled container in which you store information.

Here, the variable is named $olChiki. It holds a list of Ol Chiki characters.

The square brackets [ and ] create an array. An array is a collection of values stored under one variable name.

Analogy: Imagine a school attendance register containing the names of 30 students. Instead of creating 30 separate variables, you keep all the names together in one register. That register is like an array.

Each character is written inside quotation marks, and commas separate the items.

For example:

$letters = ["ᱚ", "ᱛ", "ᱜ"];

This smaller array contains three characters. Our actual program contains 30 characters.

The closing ]; means that the list is finished. The semicolon ; marks the end of this PHP statement.

Why is this list important? The program uses it as its reference checklist. It does not automatically discover every possible letter in the language; it checks only the characters included in this array.

Step 3: Collect the sentence entered by the user

$sentence = $_POST['sentence'] ?? "";

This line collects the sentence submitted through the webpage.

Let us break it down.

$sentence

This variable stores the user's sentence.

$_POST

This is a special PHP variable containing data submitted to the server using an HTTP POST request.

Later, the HTML form will include a text area named sentence. When the user presses the Check button, the browser sends the text to PHP.

['sentence']

This selects the submitted value associated with the field named sentence.

?? ""

This is called the null coalescing operator. It means: if the submitted field is unavailable or its value is null, use an empty string instead.

An empty string is simply text containing no characters.

Why is this useful? When someone opens the webpage for the first time, they have not submitted a sentence yet. The program needs a safe default value rather than assuming that the form has already been submitted.

Think of it like a form at a school office. If nobody has filled in the name field yet, the register starts with a blank space.

Step 4: Clean the input

$clean = preg_replace('/\s+/u', '', $sentence);

Before checking the sentence, the program creates a cleaned version of it.

The function preg_replace() searches text using a pattern and replaces matching portions with something else.

Its three arguments here are:

  1. '/\s+/u' — the pattern to search for.

  2. '' — the replacement, which is an empty string.

  3. $sentence — the original sentence.

The pattern has two important parts.

  • \s+ matches one or more whitespace characters, such as spaces, tabs, and line breaks.

  • u tells the regular-expression engine to treat the input as UTF-8.

For example, imagine the user enters:

ᱚ ᱛ
ᱜ

The cleaned result becomes:

ᱚᱛᱜ

Analogy: Imagine removing the spaces between objects on a table so you can inspect each object more easily. The objects remain; only the spaces are removed.

One important detail: the comment in the original code says “remove spaces, punctuation,” but this expression removes whitespace only. It does not remove punctuation. If punctuation is present in the input, it remains in $clean.

That is not necessarily a problem for this particular checker because it searches for the letters in the reference array, rather than counting punctuation.

Also, $clean is a new variable. The original $sentence remains unchanged, so the webpage can show the user's original text again.

Step 5: Prepare a list of missing letters

$missing = [];

This creates an empty array named $missing.

At the beginning, the program does not know which letters are missing. It starts with an empty list and adds letters as it discovers them.

Imagine a teacher holding an empty list titled “Absent students.” Every time the teacher finds a student who has not attended, their name is added to that list.

The variable $missing serves the same purpose.

Step 6: Examine every letter in the alphabet

foreach ($olChiki as $letter) {

The foreach loop processes each item in an array, one at a time.

In our program:

  • $olChiki is the complete reference list.

  • $letter holds the current character being checked.

Imagine that the teacher reads the attendance register one name at a time:

  1. Check the first student.

  2. Check the second student.

  3. Continue until every student has been checked.

That is exactly what the loop does with the Ol Chiki alphabet.

The opening curly brace { marks the beginning of the loop's code block. The corresponding closing brace } appears after the instructions that should run for each letter.

Step 7: Search for the current letter

if (mb_strpos($clean, $letter) === false) {
    $missing[] = $letter;
}

This is where the actual checking happens.

First, mb_strpos()

The function mb_strpos() searches for one string inside another and returns the position where the match begins.

For example:

mb_strpos("ᱚᱛᱜ", "ᱛ");

If the characters are represented correctly and the required PHP extension is installed, the function finds ᱛ at position 1, because PHP string positions start at zero.

It returns false when the character cannot be found.

Why not use the ordinary strpos() function? Ol Chiki uses Unicode characters, and Unicode characters can occupy multiple bytes in UTF-8. The multibyte-aware mb_strpos() function searches by characters rather than treating each byte as an independent character.

Your PHP installation needs the mbstring extension for mb_strpos() to work.

Next, === false

This checks whether the search result is exactly the Boolean value false.

The three equal signs === mean strict comparison: both the value and its type must match.

This matters because a character found at position zero is a valid match. A loose comparison could mistakenly treat the numeric value 0 as false.

Finally, $missing[] = $letter;

If the character cannot be found, this line adds it to the $missing array.

The empty square brackets [] mean “append this value to the end of the array.”

For example:

$missing = [];
$missing[] = "ᱚ";
$missing[] = "ᱛ";

The result is an array containing two missing letters.

The entire if statement is like a teacher asking, “Is this student on the attendance list?” If the answer is no, the teacher writes the student's name on the absent list.

Step 8: Decide whether the sentence is a pangram

$isPangram = empty($missing);

The empty() function checks whether a variable is empty.

If $missing contains no letters, empty($missing) evaluates to true.

If $missing contains one or more letters, it evaluates to false.

The result is stored in $isPangram.

In plain English:

  • No missing letters means the sentence passes the check.

  • One or more missing letters means the sentence does not pass.

This variable is a Boolean value, meaning it represents one of two states: true or false.

Step 9: Close the PHP section

?>

This closes the first PHP section.

After this point, the file contains HTML that defines the webpage. PHP can be opened again later wherever the program needs to insert dynamic content.

This is one reason PHP is convenient for small web applications: it can combine server-side logic with an HTML page in a single file.

4. Building the webpage with HTML

The next section creates the visible page that the user interacts with.

Step 10: Tell the browser that this is an HTML document

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Santali Pangram Checker</title>
</head>

<!DOCTYPE html> tells the browser to interpret the document as modern HTML.

<html> is the root element containing the webpage.

<head> contains information about the document rather than the main visible content.

The line:

<meta charset="UTF-8">

is particularly important. It tells the browser to interpret the document using UTF-8 encoding, allowing Ol Chiki characters to be represented correctly.

However, encoding alone does not guarantee that every device has a suitable font. If the device cannot display Ol Chiki, some characters might appear as empty boxes.

Finally:

<title>Santali Pangram Checker</title>

sets the title shown in the browser tab.

Think of this section as the label and technical instructions attached to a package. It tells the browser what it is opening and how to interpret the contents.

Step 11: Add the heading

<body>
    <h2>Santali Pangram Checker (Ol Chiki)</h2>

The <body> element contains the main content displayed on the webpage.

The <h2> element creates a second-level heading. In this case, it displays the application's name.

You can change the heading to whatever title you prefer, such as “Ol Chiki Alphabet Challenge.”

Step 12: Create the input form

<form method="post">
    <textarea name="sentence" rows="4" cols="60"
        placeholder="Enter a Santali sentence in Ol Chiki script..."><?= htmlspecialchars($sentence) ?></textarea><br><br>
    <button type="submit">Check</button>
</form>

This is the part where users interact with the program.

The <form> element

A form collects information from the user and submits it to the server.

The attribute method="post" tells the browser to send the form data using the POST method.

The <textarea> element

This creates a multi-line text box where users can paste or type a Santali sentence.

Its attributes have specific jobs:

  • name="sentence" gives the input a name. PHP uses this name to find the submitted text in $_POST['sentence'].

  • rows="4" suggests a height of four lines.

  • cols="60" suggests a width of 60 character columns.

  • placeholder="..." displays helpful instructions when the box is empty.

The name sentence connects the HTML form to the PHP code. If you change it in the HTML, you must also change the corresponding key in the PHP code.

The PHP expression inside the text area

<?= htmlspecialchars($sentence) ?>

The shorthand <?= ... ?> tells PHP to evaluate an expression and print its result.

The function htmlspecialchars() converts special HTML characters into safe representations before displaying the text.

For example, it prevents user-entered text containing < or > from being interpreted as HTML markup. This is an important protection when displaying user input.

It also allows the submitted sentence to remain visible after the form is processed.

The <br> elements

Each <br> inserts a line break. The two breaks here create some vertical space between the text box and the button.

The submit button

<button type="submit">Check</button>

When the user clicks this button, the browser submits the form to the server. PHP then receives the sentence and runs the checking logic again.

Think of the form as a post office counter: the user fills in a document, presses the button, and sends it to the program for processing.

5. Displaying the result

The final PHP section decides which message should appear.

Step 13: Check whether the user entered a sentence

<?php if ($sentence): ?>

This begins a PHP conditional statement.

if means “run this section only when the condition is true.”

Here, the condition checks whether $sentence contains a non-empty value.

The colon : begins the alternative PHP template syntax. It is useful when PHP is mixed with HTML because it makes the page easier to read.

The closing syntax for this form is:

<?php endif; ?>

It marks the end of the conditional block.

If no sentence has been entered, the result section remains hidden. This prevents the webpage from displaying a result before the user submits anything.

Step 14: Decide whether all letters are present

<h3>Result:</h3>

<?php if ($isPangram): ?>
    <p style="color:green;">✅ This sentence IS a Santali pangram.</p>
<?php else: ?>
    <p style="color:red;">❌ This sentence is NOT a Santali pangram.</p>
    <p>Missing letters:</p>
    <p><?= implode(" ", $missing) ?></p>
<?php endif; ?>

The program now uses $isPangram, which was calculated earlier.

If $isPangram is true, the first message appears in green.

If it is false, the else branch runs and displays a red message along with the missing letters.

What does else mean?

It means “if the previous condition is not true, do this instead.”

What does implode(" ", $missing) do?

The function implode() joins all the values in an array into a single string.

The first argument, " ", is the separator: one space between each item.

Suppose:

$missing = ["ᱚ", "ᱛ", "ᱜ"];

Then:

implode(" ", $missing);

produces:

ᱚ ᱛ ᱜ

Without implode(), PHP would not automatically display the array as a nicely formatted list of letters.

The program can now show the user exactly which reference letters were not found in the sentence.

6. How the whole program works together

Here is the complete journey from the user's text to the final result:

  1. The webpage displays a text box.

  2. The user enters a Santali sentence and clicks Check.

  3. The browser sends the sentence to PHP.

  4. PHP removes whitespace from a working copy of the sentence.

  5. The program checks each of the 30 reference letters.

  6. Every letter that cannot be found is added to $missing.

  7. PHP determines whether $missing is empty.

  8. The webpage displays the result and, if necessary, the missing letters.

The important lesson is that the program does not understand the meaning of the sentence. It performs a character-presence check against a predefined list.

7. A few improvements to consider

The original code is a good learning project, but there are some details worth understanding before using it as a language-reference tool.

First: the program checks only the letters you listed. If the reference array is incomplete or contains an incorrect character, the result will reflect that mistake. Verify the list against an authoritative Ol Chiki alphabet reference.

Second: punctuation is not removed by the current regular expression. The expression removes whitespace only. This does not usually affect the missing-letter check, but the comment should be updated or the cleaning function expanded if punctuation removal is required.

Third: repeated letters do not matter. A letter appearing ten times still counts as present, because the program checks whether the letter exists at least once.

Fourth: this is a character checker, not a grammar checker. A sentence can contain all 30 listed characters without being a grammatically correct or meaningful Santali sentence.

Fifth: Unicode support matters. The page should use UTF-8, and PHP must have the mbstring extension enabled for mb_strpos() to work.

8. Try a small experiment

You can learn a lot by changing the program and observing the result.

  • Remove a letter from a sentence and check whether it appears in the missing-letter list.

  • Repeat one letter several times and see whether the result changes.

  • Add extra spaces and line breaks. They should not affect the result because the program removes whitespace before checking.

  • Change the heading in the HTML and refresh the page to see how the interface changes.

  • Add a temporary test letter to $olChiki and observe what happens when that character is absent.

Experimenting is one of the best ways to understand programming. You do not need to memorize every function immediately. Learn what each part does, test it, and gradually build more features.

Conclusion

You have now explored the main building blocks of a small PHP application: variables, arrays, loops, conditions, Unicode-aware searching, HTML forms, and safe output.

The same approach can support other Santali language-technology projects, such as alphabet-learning games, character-frequency counters, Ol Chiki proofreading tools, and educational exercises.

A simple program like this demonstrates an important idea: technology does not have to begin with a complicated application. It can start with a small problem in your own language and a few lines of code.

Keep experimenting, keep learning, and help make Santali more accessible in the digital world.

Add the complete runnable PHP fileAdd setup and run instructions

Let us create a Santali Pangram Checker | Build a Santali Pangram Checker Using PHP: A Beginner-Friendly Tutorial Let us create a Santali Pangram Checker | Build a Santali Pangram Checker Using PHP: A Beginner-Friendly Tutorial Reviewed by Prasanta Hembram on Saturday, October 24, 2026 Rating: 5

No comments:

Please share your comments or feedback here.

Powered by Blogger.