text editing

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
blackarib
-


Joined: 19 Jun 2004
Posts: 48

PostPosted: Sun Nov 28, 2004 11:30 pm    Post subject: text editing Reply with quote

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 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
admin
Site Admin


Joined: 03 Mar 2002
Posts: 1332

PostPosted: Tue Nov 30, 2004 11:22 am    Post subject: Re: text editing Reply with quote

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 View user's profile Send private message
blackarib
-


Joined: 19 Jun 2004
Posts: 48

PostPosted: Thu Dec 02, 2004 4:14 pm    Post subject: Reply with quote

Anyone have any ideas how you would do this?
Back to top View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Glitch2082
-


Joined: 02 Dec 2004
Posts: 194

PostPosted: Sat Dec 04, 2004 2:18 am    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail
blackarib
-


Joined: 19 Jun 2004
Posts: 48

PostPosted: Sat Dec 04, 2004 12:55 pm    Post subject: Reply with quote

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 View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group