String functions

1. String statistics and encryption

  strlen($str): get the length of the string

  str_word_count($str,$format,$charlist): count the number of words contained in the string

    $format: an optional parameter that determines the format in which the statistical results are output

      0 (default): directly return an integer number;

      1: Output each word as a key value as a new index array;

      2: Use the position where each word appears as the key name, each word as the key value, and output as a new array;

    $charlist: optional parameter, additional string, the characters in which are counted as part of the word

  md5($str): returns the encrypted string

2. Remove spaces or other strings

3. Editing of strings

Fourth, the splitting and splicing of strings

Five, string interception

Six, string find and replace

Seven, case conversion

Eight, string comparison

Nine, HTML tag association

  ord($str): get the ASCII code value of a character

  chr($ascii): Get the specified character according to the ASCII code value

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326482565&siteId=291194637