Jump to content

Removing section of text


Canman2005

Recommended Posts

Hi all

 

Wonder if someone can help

 

What I have is text for each page of my site which is stored in a sql table, to print the text on the pages I use

 

<?php
print $row['content'];
?>

 

The following is an example of the type of content stored

 

------------------------------------------------

 

Welcome to the contact page

 

*C*

page check

*C*

 

Please use the navigation bar above

 

------------------------------------------------

 

What I want to do is to remove the section of the content which is between and including

 

*C*

page check

*C*

 

So it would just print the content as

 

------------------------------------------------

 

Welcome to the contact page

 

Please use the navigation bar above

 

------------------------------------------------

 

Can this be done?

 

Any help would be great

 

Thanks in advance

 

Dave

Link to comment
https://forums.phpfreaks.com/topic/65620-removing-section-of-text/
Share on other sites

Thanks for that, but what I meant was that it would replace anything between

 

*C*

 

So it would basically use them as tags, I could change them all to

 

*C-start*

 

and

 

*C-end*

 

so that it knows what the start tag is and what the end tag is

 

can this be done in this case?

 

Thanks again

 

Dave

Sorry, might not be making much sense.

 

Basically I want to get rid of everything that is held between two tags, so if the page content was

 

-----------------------

Welcome to the page

 

*C*

click here

*C*

----------------------

 

then it would strip out the following

 

*C*

click here

*C*

 

and simply print

 

--------------------------

welcome to the page

--------------------------

 

does the make any sense?

 

Thanks

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.