菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码
运行
保存
",$str1); // String printf("[%8s]
",$str1); // Right-justifies the string with spaces printf("[%-8s]
",$str1); // Left-justifies the string value with spaces printf("[%08s]
",$str1); // Zero-padding printf("[%'*8s]
",$str1); // Adds "*" printf("[%8.8s]
",$str2); // Left-justifies the string with spaces (cuts off characters after the specified value) ?>
运行结果
[Hello]
[ Hello]
[Hello ]
[000Hello]
[***Hello]
[Hello wo]