/**
* Fills a string into a string of a specified length (Multi-byte security)
* @param string $str to specify the character to be populated
* @param int $len Specifies the length of the filled string, if the value is negative or less than the length of the string is not populated
* @param string $pad _str to be populated
* @param int $pad _type Specifies the direction of the fill str_pad_right,str_pad_left or Str_pad_both
* @return String
*/
String Str_pad (string $str, int $len, String $pad _str, String $pad _type);
Echo Str_pad ($result 2[0],6, "0", str_pad_left);
Copy CodeThe code is as follows:
$input = "Alien";
Echo Str_pad ($input, 10); Produces "Alien"
Echo Str_pad ($input, ten, "-=", str_pad_left); Produces "-=-=-alien"
Echo Str_pad ($input, Ten, "_", Str_pad_both); Produces "__alien___"
Echo Str_pad ($input, 6, "___"); Produces "Alien_"
?>
http://www.bkjia.com/PHPjc/321218.html www.bkjia.com true http://www.bkjia.com/PHPjc/321218.html techarticle /** * Fills a string into a string of a specified length (multibyte security) * @param string $str Specifies the character to be populated * @param int $len Specify the length of the string to be populated, if the value ...