View previous topic :: View next topic |
Author |
Message |
blackarib -
Joined: 19 Jun 2004 Posts: 48
|
Posted: Sun Nov 28, 2004 11:30 pm Post subject: text editing |
|
|
with php how can i edit a text file to for example delete the following tags and everything in between them? Thanks
Code: | #start id=22
a bit of code in the middle
#end id=22 |
|
|
Back to top |
|
 |
admin Site Admin
Joined: 03 Mar 2002 Posts: 1332
|
Posted: Tue Nov 30, 2004 11:22 am Post subject: Re: text editing |
|
|
blackarib wrote: | with php how can i edit a text file to for example delete the following tags and everything in between them? Thanks
Code: | #start id=22
a bit of code in the middle
#end id=22 |
|
You can do it of course, but you'll have to write the code for it. There is no function that can do all this in one call. We recommend downloading the PHP manual and reading the documentation of string manipulation functions to get started. |
|
Back to top |
|
 |
blackarib -
Joined: 19 Jun 2004 Posts: 48
|
Posted: Thu Dec 02, 2004 4:14 pm Post subject: |
|
|
Anyone have any ideas how you would do this? |
|
Back to top |
|
 |
Glitch2082 -
Joined: 02 Dec 2004 Posts: 194
|
Posted: Sat Dec 04, 2004 2:18 am Post subject: |
|
|
I like to include full files for some reason. What I would do is this...
Code: |
<?php include 'id22_start.php' ?>
// ID22_start.php will have the start id tag
<?php include the_middle_code.php ?>
// The_Middle_Code.php will be the file that contains the code that just goes in the center.
<?php include 'id22_end.php' ?>
// id22_end.php will be the id22 end tag
|
And if you want to change the middle code text with php just fwrite the_middle_code.php
And if its all in one big php tag you wont need to add the <?php and ?>, just the include, thought I should say this sence I forgot myself.
Hope that helps. |
|
Back to top |
|
 |
blackarib -
Joined: 19 Jun 2004 Posts: 48
|
Posted: Sat Dec 04, 2004 12:55 pm Post subject: |
|
|
What i need to be able to do is pick out that bit of code from a file that has a lot more than that in it and edit that bit of text, how would I do that? |
|
Back to top |
|
 |
|