473,769 Members | 5,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Remove the extra space

5 New Member
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
4 2604
stepterr
157 New Member
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
ashish1779
5 New Member
I am try all these but it is didn't remove any space.
Jan 22 '08 #3
ak1dnar
1,584 Recognized Expert Top Contributor
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
157 New Member
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

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

Similar topics

2
3231
by: revjjjames | last post by:
Hello - What is the correct expression to remove any extra line breaks beyond two in a string? Sincerely, Jim
8
2865
by: JT | last post by:
i have written some asp that reads a fixed length text file, line by line, inserting each line into my database. my problem is that the text file format seems to have extra space at the end of the file so my code thinks there is actually one more line when there is not. is there a way to remove these spaces before i loop through the file? here is my sample code: Do While df.AtEndOfStream <> True line = df.ReadLine
2
9612
by: collinm | last post by:
hi here my code FILE *fp; char *line; #define LINE_MAX 30 fp = fopen("test1.txt", "r");
1
1808
by: Arjen | last post by:
Hello, In code view I use a tab as mark-up character. When I run my web application I can see the tabs with the source viewer in my browser. Is there a way to remove the tabs, extra spaces and lines when running the web application? I want to remove them for performance reasons.
7
16476
by: Bosconian | last post by:
I know that str.replace(/^\s+|\s+$/g,''); will trim a string of space, but what about removing extra spaces from the middle? Where "hello world"
34
4113
by: Registered User | last post by:
Hi experts, I'm trying to write a program that replaces two or more consecutive blanks in a string by a single blank. Here's what I did: #include <stdio.h> #include <string.h> #define MAX 80
3
4065
by: afr02hrs | last post by:
Hi Experts I am trying to get the following program running correctly. I would like to be able to input a line of text containing multiple space characters between words and have the program remove any number of excess space characters so that the sentence is rewritten correctly containing only 1 space character between individual words. However this program outputs each word on a separate line! Is there a problem with my loop? Many...
8
1997
by: dancer | last post by:
Using ASP.net 1.1 to create user input form. When I put a RequiredFieldValidator I have extra space at the bottom of the cell, as if I had put a <br>. When I comment out the RequiredFieldValidator, the extra space goes away. Don't want that extra space, but want the validator. What can I do?
1
4421
by: bdbeames | last post by:
I am currently getting some forecast data from a web site using (file_get_contents), then I'm using explode to put the string in an array, which I am then parsing. The trouble is when I use explode() are several empty elements between each full one. Example. Array ( => this => is => => => a => => => test ) If I print the sting before I explode it I only see one space between each word, but the it seems to be that there is more...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9994
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.