in vb i could
vlevel = 4 str=Replace(Space(vlevel)," "," ")
result *4 or
to add a dynamic number or a characters to a string.
any way to do this in php?
vlevel = 4 str=Replace(Space(vlevel)," ","nbspnbsp")
result spacespace*4 or nbspnbspnbspnbspnbspnbspnbspnbsp
Hmm, I odn't know VB or ASP, but I'll give it my best shot:
$str = str_replace(" "," ",$str);
Not sure if that is exactly what you want, but I'm sure you can change it to what you want 🙂
-Josh
Hmm, it didn't quite show up properly...
$str = str_replace(" "," ",$str);
Here's to hoping it shows up properly 🙂
thanks josh. what i want to do is
$num = 5;
$str = str_replace("$num"," ",$str);
to get the result of 5 spaces.
5 times nbsp
or
$space = "nbsp"; echo($space*$num)
something like that. sorry for being confusing.
Take a look at the str_repeat() function: http://www.php.net/manual/en/function.str-repeat.php
I think that with str_replace() you should be able to find something that works.