|
-
May 10th, 2002, 01:14 PM
#1
Thread Starter
Fanatic Member
using removetags function
When you use the removetags function on a html code it basically removes every html tag there is in the code. This however caused me a little bit of a problem, since it leaves many blank lines after removing the tags. For example this code:
Code:
<html>
<body>
<whatever tag you want>
<script>
</script>
would produce five blank lines. Do you know how to get rid of these blank lines? THanks for any help.
Q
-
May 10th, 2002, 03:25 PM
#2
Stuck in the 80s
Use the Trim() function to remove whitespaces at the begining and ending of the string.
-
May 10th, 2002, 05:29 PM
#3
removetags function? where did you get it.
-
May 10th, 2002, 06:03 PM
#4
PowerPoster
I would imagine he meant the strip_tags function
If so, I don't get the same behaviour you appear to be having with strip_tags
-
May 10th, 2002, 08:32 PM
#5
Thread Starter
Fanatic Member
it is strip_tags actually. Sorry, I couldn't remember the name before.
If you don't get the same behavior, do you think that it might have something to do with the php settings on the server? Because I certainly do have that problem (on two different servers actually)
-
May 10th, 2002, 09:42 PM
#6
Member
chrisjk is probably right in that you don't get that problem with this function, but if the prob remains, do you think you shud do a string replace and replace all "\n" with "" ? essentially, remove the new lines...that are what the blank lines are...
-
May 10th, 2002, 11:19 PM
#7
Stuck in the 80s
It could be a difference in PHP versions too. Functions change in different updates.
-
May 11th, 2002, 01:32 AM
#8
Thread Starter
Fanatic Member
I acutally tried that approach (removing \n) - didn't work
-
May 11th, 2002, 01:22 PM
#9
what is the code in question?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|