Re: str_repeat in Smarty
| From: | Andrei Zmievski | Date: | Sat, 22 Sep 2001 15:14:10 +0000 |
| Subject: | Re: str_repeat in Smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1526@lists.php.net to get a copy of this message | ||
On Sat, 22 Sep 2001, Michael Jensen wrote:
> Hovdy
>
> I want to get ex.
>
> "    "
>
> from 4 and  .
> In php there is a function called str_repeat(4," ")
>
> How do I get that result with Smarty?
If you have your string in a variable you can just use str_repeat() as a
modifier:
{$foo|str_repeat:4}
Otherwise you'll have to write a custom function perhaps.
-Andrei
"I still find each day too short for all the thoughts I want to think,
all the walks I want to take, all the books I want to read, and all the
friends I want to see."
-John Burroughs