0

I have following string stored in my DB Table.

Tahseen A      test1   TEST TRANSFER LTD  BBP

As you can see it has multiple spaces in between words. But when get this string using following code

<td class="transactions"><?=$fullRS[$i]["columnName"]?></td>

The result on my php page shows its value as:

Tahseen A test1 TEST TRANSFER LTD BBP

You can see it removes extra spaces in between words of the string. Question is how can i show the same string that is stored i DB on php page?

3
  • PHP does not truncate space unless explicitly written. Could you do a var_dump() of $fullRS[$i]["columnName"]? Commented May 5, 2014 at 10:01
  • check the css definition transactions looks like its doing some sort of padding. Commented May 5, 2014 at 10:02
  • yes. The result set coming from DB has the same value which is stored in DB i.e. With spaces. But when the browser seems to truncating extra spaces. Commented May 5, 2014 at 10:04

1 Answer 1

1
<td class="transactions"><?php echo str_replace(" ","&nbsp;",$fullRS[$i]["columnName"]) ?></td>
Sign up to request clarification or add additional context in comments.

1 Comment

thanks it did the work. But still don't know what is the actual problem. As per comment by @abhik css definition is not the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.