0

I am trying to create a variable that has a string repeated x amount of times depending on what $tagtime3 =

This is what I have so far:

$tagtime = $length / $overlaylength;
        $tagtime3 = floor($tagtime);
        $stringtoloop = "' . $tagmp3 . '";
        for ($k = 0 ; $k < $tagtime3; $k++){ $finalstring = +.$stringtoloop; }

I think it could be done by pushing the string ' . $tagmp3 . ' into a variable within the loop.

0

2 Answers 2

2

Maybe just str_repeat($stringtoloop,$tagtime3);?

Sign up to request clarification or add additional context in comments.

Comments

0

I just discovered str_repeat this will repeat the string n amount of times:

$tagtime = $length / $overlaylength;
            $tagtime3 = floor($tagtime);
            $stringtoloop = "' . $tagmp3 . '";

            $test = str_repeat($stringtoloop, $tagtime3); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.