📜 ⬆️ ⬇️

School portal captcha emulator

Everyone remembers a recent article about an interesting captcha on the website of the School Portal ?
How much joy these words brought us:


I wrote in PHP a compact word generator that works on the same principle.

Generator Code:


<? php
$ glasn = array ( "" , "" , "" , "" , "" , "" , "" , "" , "" );
$ soglasn = array ( "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" , "" );
$ length = 6 ;
$ word = "" ;
for ($ i = 1 ; $ i <=$ length / 2 ; $ i ++)
{
$ word .=$ soglasn [ rand ( 0,20 )].$ glasn [ rand ( 0,8 )];
}
echo $ word ;
? >

* This source code was highlighted with Source Code Highlighter .


Principle of operation: The consonant and vowel letters are arbitrarily chosen from two arrays and a syllable is composed of them. Then a word of the required length is made up of syllables. It is displayed in plain text.
Working example
')
Variables:
$ length - word length. Must be an even number.

Post Scriptum: None of the snout of the snout snout! :)

Source: https://habr.com/ru/post/44270/


All Articles