这段php代码定义了两个函数 str_prefix和str_suffix,分别用来给字符串前后添加指定数量的符号
function str_prefix($str, $n=1, $char=" "){ for ($x=0;$x<$n;$x++){ $str = $char . $str; } return $str; } function str_suffix($str, $n=1, $char=" "){ for ($x=0;$x<$n;$x++){ $str = $str . $char; } return $str; } //用法举例: str_prefix('test', 3, '-') => returns '---test'<br/>str_suffix('test', 3, '-') => returns 'test---'<br/>