-2

I have an input text form but sometimes some forms are not filled with text, but I don't want to generate blank space in my echo page. How can I eliminate this lost space if my input text is not entered in the form.

<? echo $rows['info']; ?>
4

3 に答える 3

3
<? echo trim($rows['info']); ?>

http://php.net/manual/en/function.trim.php

于 2012-10-04T18:56:45.097 に答える
1

You should use the php trim() function.

于 2012-10-04T18:57:00.647 に答える
-1

use trim:

<? echo trim($rows['info']); ?>

add the <br />:

$info = trim($rows['info']);

if (!isEmpty($info)) {
    echo $info . "<br />";
}
于 2012-10-04T18:57:10.647 に答える