我想重複特殊字符 或TAB。用str_repeat重複特殊字符
我嘗試用str_repeat(STR,INT)
//my function repeat
function tab($num){
return str_repeat('	', $num);
}
//if I call
echo '<table>' . "\r\n";
echo tab(3) . '<tr>';
//the result
<table>
			<tr>;
我試圖用單引號和雙引號, 幾種方法,但結果總是錯的
這是什麼問題?嘗試在它們後面加上' '。 – Heavy
問題是爲什麼你想要做這樣的事情? – Rikesh
@Rikesh在我的代碼中修飾縮進,使其看起來更具可讀性。 – rslhdyt