make string of N characters

一曲冷凌霜 提交于 2019-11-29 09:05:03
$a=str_repeat($value,$number);

You can use str_repeat(), e.g.

$a=str_repeat('7', 20);

Use str_repeat():

$a = str_repeat('7', 20);

str_repeat is pretty easy

$a = str_repeat('7', 20);
$a = str_repeat('7', 20);

str_repeat()

...or maybe:

$a = str_pad('', 20, '7');

str_pad()

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!