Home / PHP Tips Generated By ChatGPT / Repeating Strings in PHP Repeat a string a specified number of times with str_repeat(). Source Code echo str_repeat("Hip ", 3) . "Hooray!"; // Outputs: Hip Hip Hip Hooray!