Jump to content

PHP remove data between tags


ursvmg

Recommended Posts

Hi,

I have a very big html page, from which i need to remove data between specific tags. The edited html will then be used for parsing. Since the piece to be removed has unwanted(huge) data, which I don't want to be parsed.

 

I did some google search, but I found none to be more effective. Most of them uses preg_replace.

 

Is there any other way to do it?

 

Could you please advice me on this.

 

Regards,

Ursvmg

Link to comment
https://forums.phpfreaks.com/topic/204003-php-remove-data-between-tags/
Share on other sites

.
.

<td>
<form name="statuses" method=post><select name=status style="BACKGROUND-COLOR:#B3C7D7; font-family: verdana;font-weight:normal; font-size: 11px; color:black;" 
onChange="location=document.statuses.status.options[document.statuses.status.selectedIndex].value"> 
<option value="">[-  Select Status  -]
<option value="">-----------------
<option value="a.asp?status=On&state=&city=&category=R">On Schedule

<option value="a.asp?status=PP&state=&city=&category=R">Postponed
<option value="a.asp?status=C&state=&city=&category=R">Cancelled
</select></td></form>

<td>
<form name="categories" method=post><select name=category style="BACKGROUND-COLOR:#B3C7D7; font-family: verdana;font-weight:normal; font-size: 11px; color:black;" 
onChange="location=document.categories.category.options[document.categories.category.selectedIndex].value"> 


<option value="R">

Real Estate


<option value="">-----------------
<option value="a.asp?category=R&state=&city=&status=">Real Estate
<option value="a.asp?category=P&state=&city=&status=">Personal Property
<option value="a.asp?category=O&state=&city=&status=">Other
</select></td></form>

</table>
.
.

I would like to remove data between <form> tags.

 

 

You could use str_replace to put markers in the code and then remove things between the markers, I did that once on a similar project when I didn't know what I was doing, turned out I could have done it 10 times quicker and easier with preg_replace.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.