Hướng dẫn metaphone() function in php
❮ PHP String Reference ExampleCalculate the metaphone key of "World": echo metaphone("World"); Try it Yourself » Definition and UsageThe metaphone() function calculates the metaphone key of a string. A metaphone key represents how a string sounds if said by an English speaking person. The metaphone() function can be used for spelling applications. Note: The metaphone() function creates the same key for similar sounding words. Note: The generated metaphone keys vary in length. Tip: metaphone() is more accurate than the soundex() function, because metaphone() knows the basic rules of English pronunciation. SyntaxParameter Values
Technical Details
More ExamplesExampleUsing the metaphone() function on two similar sounding words: $str = "Assistance"; echo metaphone($str); Try it Yourself » ExampleUsing the length parameter: $str = "Assistance"; echo metaphone($str,5); Try it Yourself » ❮ PHP String Reference Xử lý chuỗi đóng vai trò rất quan trọng trong lập trình PHP, dưới đây là tập hợp những hàm thường dùng nhất 1 addcslashes :Trích dẫn xâu kí tự với những vạch chéo trong kiểu C 2 addslashes :Trích dẫn xâu kí tự với những vạch chéo 3 bin2hex :Chuyển đổi dữ liệu dạng nhị phân sang dạng biểu diễn hệ hexa 4 chop :Tách bỏ nhưng khoảng trắng từ cuối một xâu 5 chr : Cho một kí tự đặc biệt trong bảng mã 6 chuck split : Tách một xâu thành các xâu nhỏ hơn 7 convert_cyr_string :Chuyển đổi từ một kí tự kirin sang một kí tự khác 8 count_chart : Cho thông tin về các kí tự dùng trong xâu 9 crc32 : Tính toán sự thừa vòng đa thức của một xâu 10 crypt :Một cách mã hóa một xâu 11 echo : In ra một hay nhiều xâu 12 explode :Tách một xâu ra bởi xâu kí tự 13 fprintf :Viết một định dạng chuỗi ra một dòng 14 get_html_translation_table :Cho ra bảng dịch bằng cách sử dung các thủ tục html entity decode : 15 hebrev :Chuyển đổi văn ban logic khó hiểu sang văn ban trưc quan 16 hebrevc :Chuyển đổi văn ban logic khó hiểu sang văn ban trưc quan với sự chuyển đổi dòng mới 17 html_entity_decode :Chuyển đổi tấtcả cácthực thể HTML sang những kí tự có thể dùng được của chúng 18 htmlentities :Đổi tất cả các kí tự được sử dung sang các thực thể HTML 19 htmlspecialchars :Đổi những kí tự đặc biệt sang các thực thể của HTML 20 implode :Nối các phần tử của mảng với một xâu 21 join :Hàm này là một bí danh của hàm implode 22 levenshtein :Tính khoảng cách giữa hai xâu 23 localeconv :Lấy ra thông tin quy cách số 24,lstrim-- Strip whitespace from the beginning of a string 25,md5_file-- Calculates the md5 hash of a given filename 26,md5 -- Calculate the md5 hash of a string 27,metaphone -- Calculate the metaphone key of a string 28,money_format -- Formats a number as a currency string 29,nl_langinfo -- Query language and locale information 30,nl2br -- Inserts HTML line breaks before all newlines in a string 32,ord -- Return ASCII value of character 33,parse_str -- Parses the string into variables 34,print -- Output a string 35,printf -- Output a formatted string 36,quoted_printable_decode -- Convert a quoted-printable string to an 37,quotemeta -- Quote meta characters 38rtrim -- Strip whitespace from the end of a string 39,setlocale -- Set locale information 40,sha1_file -- Calculate the sha1 hash of a file 41,sha1 --
Calculate the sha1 hash of a string 42,similar_text -- Calculate the similarity between two strings 43,soundex -- Calculate the soundex key of a string 44,sprintf -- Return a formatted string 45,sscanf -- Parses input from a string according to a format 46,str_ireplace -- Case-insensitive version of str_replace(). sscanf-- Parses input from a string according to a format str_ireplace-- Case-insensitive version of str_replace(). str_pad-- Pad a string to a certain length with another string str_repeat--Repeat a string str_replace-- Replace all occurrences of the search string with the replacement string str_rot13--Perform the rot13 transform on a string str_shuffle--Randomly shuffles a string str_split-- Convert a string to an array strchr--Alias of strstr() strcmp--Binary safe string comparison strcoll--Locale based string comparison strcspn-- Find length of initial segment not matching mask strip_tags--Strip HTML and PHP tags from a string stripcslashes-- Un-quote string quoted with addcslashes() stripos-- Find position of first occurrence of a case-insensitive string stripslashes-- Un-quote string quoted with addslashes() stristr-- Case-insensitive
strstr() strlen--Get string length strnatcasecmp-- Case insensitive string comparisons using a "natural order" algorithm strnatcmp-- String comparisons using a "natural order" algorithm strncasecmp-- Binary safe case-insensitive string comparison of the first n characters strncmp: trả ra giá trị mà xâu1 dài hơn so với sâu hai. strpos: tìm vì trí xuất hiện đầu tiên của một xâu này trong xâu khác. strrchr: tìm kiếm vị trí xuất hiện cuối cùng của một kí tự trong xâu. strrev: đảo ngược một xâu. strripos: tìm vị trí cuối cùng của xâu này khiến nó khác một xâu cho trước. strrpos: tìm vị trí lần xuất hiện cuối cùng cùng của một kí tự trong một xâu. strspn: tính xem độ dài đoạn đầu của một xâu mà chứa toàn các kí tự thuộc xâu khác. strstr: lấy ra một đoạn của xâu từ vị trí xuất hiện kí tự cho trước. strtok: chia cắt xâu. strtolower: biến kí tự chữ hoa thành chữ thường. strtoupper: biến kí tự chữ thường thành chữ hoa. strtr: chuyển đổi kí tự theo một qui tắc nào đó. substr_compare: không có thông tin. substr_count: tính số lần xuất hiện của một xâu này trong một xâu khác. substr_replace: thay thế một đoạn văn bản trong phạm vi một đoạn của xâu kí tự. substr: rả ra một phần của xâu. trim: loại bỏ kí tự thừa(whitespace)ở đầu và cuối mỗi xâu. ucfirst: viết hoa kí tự đầu tiên của một xâu. ucwords: viết hoa kí tự đầu tiên của mỗi từ. vprints: xuất ra một xâu được định dạng vsprint: quay lại một xâu định dạng. wordswarp: chia xâu kí tự ra thành các sâu con nhờ một kí tự xác định. Sưu tầm |