简体   繁体   中英

Is there a range('a','z') for Non-English Alphabet

PHP has a function range('a','z') which prints the English alphabet a, b, c, d, etc.

Is there a similar function for other alphabets? maybe a function that accepts the language as a parameter

I doubt it. PHP isn't aware of Unicode or similar.

Also, range() doesn't print, it returns an array. To print it, you'd do echo implode(range('a', 'z')) .

Alphabetical sequences in Unicode do not follow English alpha order. You'll have to construct the string yourself. Consider defining it as a global constant

$arr = range('а', 'я');

var_dump($arr);

But this will work with cp1251 only and lost ё , since it is in the end of the ascii table

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM