Jump to content

Tag automatically closing


Solarpitch

Recommended Posts

Hi Guys,

 

I have the following

 

$pattern = '<tr class="newsitem">';

 

when I echo this out it produces

 

<tr class="newsitem">  </tr>

 

Why is it automatically closing the tag? I dont want this becuase i'm using preg_replace and the tag is closed elsewhere already on the page.

Link to comment
Share on other sites

Actually,

 

I think its to do with the preg_replace on my last post.

 

$code = preg_replace('#<!--STRIP-->(.*)<!--STRIP-->#s', '', $post);

 

Whats happening with this is, It takes the last <!--STRIP--> on the page, and removes everything from that to the last <!--ENDSTRIP-->

 

so if I have

 


<!--STRIP-->   // Will strip from here
html code...
<!--ENDSTRIP-->

html code...
<div>This is outside, but will get removed when it shouldnt</div>

<!--STRIP-->
html code...
some html code
<!--ENDSTRIP-->

<!--STRIP-->
html code...
for this example
<!--ENDSTRIP--> // To here


 

Is there a way round this?

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.