Generated with sparks and insights from 21 sources

img6

img7

img8

img9

img10

img11

Introduction

  • Introduction: Indexing Chinese surnames by stroke order involves sorting names based on the number of strokes in the characters.

  • PHP Sorting: PHP's asort function can be used to sort arrays, taking Unicode values into consideration.

  • Unicode Values: Each Chinese character has a unique Unicode value, which can be used for sorting.

  • Stroke Order: The stroke order system categorizes names based on the number of strokes and the order of strokes in the characters.

  • Example Code: A sample PHP code snippet demonstrates sorting names by their Unicode values.

Stroke Order System [1]

  • Definition: The surname stroke order system is used to categorize Chinese surnames based on the number of strokes in the characters.

  • Usage: This system is commonly used in official documentation and ceremonial procedures.

  • Order Rules: Names are ordered by the number of strokes, and if the stroke count is the same, by the order of the strokes.

  • Example: Surnames like 'Ding' (丁) with two strokes appear before 'Wang' (王) with four strokes.

  • Prominent Use: This method is used in the ordering of members in official bodies like the Central Committee of the Chinese Communist Party.

img6

img7

img8

PHP Sorting Functions [2]

  • Function: PHP's asort function sorts an array and maintains index association.

  • Unicode Consideration: asort takes Unicode values into account, making it suitable for sorting Chinese characters.

  • Example: Sorting an array of names by their first character's Unicode value.

  • Documentation: Detailed information on asort can be found in the PHP manual.

  • Usage: Commonly used for sorting arrays in various applications, including indexing names.

img6

img7

img8

img9

img10

img11

Unicode Values

  • Definition: Unicode assigns a unique value to every character, including Chinese characters.

  • Sorting: These values can be used to sort characters in a consistent manner.

  • Example: The Unicode value for '一' is 0x4E00, and for '三' is 0x4E09.

  • Conversion: Characters can be converted to their Unicode values for sorting purposes.

  • Importance: Using Unicode ensures that sorting is done in a standardized way across different systems.

img6

img7

img8

img9

img10

img11

Example Code [2]

  • Input Array: An array of names with first and last names.

  • Conversion: Convert the first character of each name to its Unicode value.

  • Sorting: Use asort to sort the array based on these values.

  • Output: Print the sorted names in order.

  • Result: Names are sorted with Latin characters first, followed by Chinese characters.

img6

Applications [1]

  • Official Documentation: Used in government and official documents to list names in a standardized order.

  • Ceremonial Procedures: Ensures impartiality in the order of names during ceremonies.

  • Databases: Useful for indexing names in databases for easy retrieval.

  • Education: Helps in teaching the order of strokes and the importance of stroke count.

  • Software Development: Can be implemented in various software applications that require sorting of Chinese names.

img6

img7

img8

img9

img10

<br><br>