Jump to content

How do I show a page, but exclude some parts?


OM2

Recommended Posts

I want to show a web page I have, but exclude some parts.

I want to parse this through PHP and output everytning apart from the exluded.

 

Let me show by example what I want.

Let's say i have the following code in my html file:

<html><head><title></title></head>
<body>
    Hello 123
    <!-- DONT SHOW START -->
    Spiderman
    <!-- DONT SHOW END -->
</body>
</html>

 

i want to be able to show this same page except when i don't want to show anything between

<!-- DONT SHOW START -->

and

<!-- DONT SHOW END -->

 

how do i do this?

 

i know i can replace everything in between the markers by doing a preg_replace: but what i'm confused about is how to show th eoutput in a browser?

 

thanks.

 

 

om

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.