|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
How to remove all empty line from HTML
There is a HTML
<tr><td> blah </td></tr> How to remove all empty lines and not to change \t |
|
#2
|
|||
|
|||
|
In a text editor that supports replacing strings with regular expression you can replace two newlines with one newline.
I do this in ultraedit from time to time. 1. Turn on regular expression checking 2. replace text: ^p^p 3. with this: ^p
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
||||
|
||||
|
Are you just trying to clean up the text? Because the browser doesn't care how much empty space there is... it skips over that when it's interpreted
|
|
#4
|
|||
|
|||
|
This is after template engine, striping not needed blocks.
I need any preg_replace, i think. |
|
#5
|
|||
|
|||
|
Try this:
<?php $content = eregi_replace("\"","'",$content); $content = eregi_replace("\n","",$content); $content = eregi_replace("\r","",$content); ?> I used it when I was writing to a Javascript variable from a MySQL database, if there is empty lines then, the script doesn´t work. Replace the PHP variable $content to the name of your own variable. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > How to remove all empty line from HTML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|