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
https://forums.phpfreaks.com/topic/232226-tag-automatically-closing/
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?

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.