John
John

Reputation: 4944

Echoing Spaces Between a Hard-Coded Word and a Variable

For the code below, how could I put 5 spaces between "Submissions:" and $row1["countSubmissions"] ?

Thanks in advance,

John

echo '<td class="sitename5">Submissions: '.$row1["countSubmissions"].'</td>';

Upvotes: 0

Views: 387

Answers (3)

Fletcher Moore
Fletcher Moore

Reputation: 13804

Look at the PHP function str_repeat

You might also consider the CSS property word-spacing, which may be a better way to accomplish what you seem to be attempting.

Upvotes: 0

Jakub Hampl
Jakub Hampl

Reputation: 40533

Use CSS - what you are probably doing belongs into the presentation layer.

Upvotes: 3

Mitch Dempsey
Mitch Dempsey

Reputation: 39879

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

Example:

echo '<td class="sitename5">Submissions: &nbsp;&nbsp;&nbsp;&nbsp;'.$row1["countSubmissions"].'</td>';

Upvotes: 4

Related Questions