How to Remove the extra space

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashish1779
    New Member
    • Jan 2008
    • 5

    How to Remove the extra space

    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
  • stepterr
    New Member
    • Nov 2007
    • 157

    #2
    Originally posted by ashish1779
    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.

    Comment

    • ashish1779
      New Member
      • Jan 2008
      • 5

      #3
      I am try all these but it is didn't remove any space.

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        Originally posted by ashish1779
        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 )

        Comment

        • stepterr
          New Member
          • Nov 2007
          • 157

          #5
          Originally posted by ajaxrand
          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!

          Comment

          Working...