By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,131 Members | 1,560 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,131 IT Pros & Developers. It's quick & easy.

How to Remove the extra space

P: 5
hi I am new in PHP, i have face one problem when I crawl any site and i have to save the whole HTML content in database, on that time all the HTML tags are changes into the extra space in content then it is saved into DB.i want to remove that extra space from content when we have to use them .

and i am not understand what how remove that space or say tags which is not shown in my contents
Jan 21 '08 #1
Share this Question
Share on Google+
4 Replies


stepterr
100+
P: 157
hello i am saving a html page into my db and i am using strip_tags, when i select that filed from DB i saw the space from that page so how to remove the space from "strip_tags"

take a look at the php function called trim if you are wanting to remove leading spaces or ending spaces. If you want spaces removed from the middle of the string then look at the str_replace function.
Jan 21 '08 #2

P: 5
I am try all these but it is didn't remove any space.
Jan 22 '08 #3

ak1dnar
Expert 100+
P: 1,584
I am try all these but it is didn't remove any space.
Why don't you show us an example of the code that you have. (Do not post all your scripts here )
Jan 22 '08 #4

stepterr
100+
P: 157
Why don't you show us an example of the code that you have. (Do not post all your scripts here )
I agree with Ajaxrand, seeing the way you have tried the script would greatly help. That way we may be able to help you correct something. Thanks!
Jan 22 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.