ralkutbi ralkutbi - 1 year ago 93
PHP Question

How can I add spaces in PHP?

echo "student id, emirate name <br>";
foreach ($resultset as $row)
echo $row['st_id'], "" , $row['em_name'],'<br />';

My question is: How can I add more spaces between st_id and em_ name? Because when I tried to run the page the information are very close to each other. I tried the quotation mark " " between them, but it just adds one space.

Answer Source

I assume that you're echoing this to a browser, in which case, & nbsp;

must be used.

echo $row['st_id'],  "&nbsp;&nbsp;" , $row['em_name'], " ",  $row['st_bday'], "",  $row['st_emirate'] , "",  $row['em_id'], "&nbsp;",  $row['em_name'],'<br />';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download