开发者

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

PHP ha开发者_JAVA技巧s 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


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

var_dump($arr);

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜