php unicode input validation snippets

16
PHP Unicode Input Validation Snippets Abdul Rahman Sherzad Lecturer at Computer Science faculty Herat University

Upload: abdul-rahman-sherzad

Post on 23-Jan-2018

197 views

Category:

Software


1 download

TRANSCRIPT

PHP Unicode Input Validation Snippets

Abdul Rahman Sherzad

Lecturer at Computer Science faculty

Herat University

Validate Digit

PHP Unicode Input Validation Snippets

Persian/Dari and Pashtu Unicode Digits

Character Unicode

۰ 06F0

۱ 06F1

۲ 06F2

۳ 06F3

۴ 06F4

۵ 06F5

۶ 06F6

۷ 06F7

۸ 06F8

۹ 06F9

Arabic Unicode Digits

Character Unicode

۰ 0660

۱ 0661

۲ 0662

۳ 0663

٤ 0664

٥ 0665

٦ 0666

۷ 0667

۸ 0668

۹ 0669

Method I: Validate Unicode Digit

Method II: Validate Unicode Digit

Validate Digit including all formats

Validate Person Names

PHP Unicode Input Validation Snippets

Validate Persian/Dari and Arabic Person names used in Afghanistan and Iran

NOTE: Zero Width Space Characters

Unicode Unicode Name

200B Zero Width Space

200C Zero Width Non-Joiner

200D Zero Width Joiner

FEFF Zero Width No-Break Space

• For clarification see the following two names:

عبدالرحمن شیرزاد•

دعبدالرحمن شیرزا•

Validate English and Persian/Dari Person names used in Afghanistan and Iran

Validate Persian/Dari and Pashtu Text

PHP Unicode Input Validation Snippets

Validate only Persian Text

NOTE: ASCII and Unicode quotation marks

Unicode Unicode Name Character

0022 Quotation Mark "

0027 Apostrophe '

0060 Grave Accent `

00B4 Acute Accent ´

2018 Left Single Quotation Mark ‘

2019 Right Single Quotation Mark ’

201C Left Double Quotation Mark “

201D Right Double Quotation Mark ”

201E Double Low-9 Quotation Mark „

201F Double High-Reversed-9 Quotation Mark ‟

2032 Prime ′

2033 Double Prime ″

Validate only Pashtu Text

Learn to

Grow

Grow to

Serve

Serve to

Learn