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
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.

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.