[PHP-DB] Read lines

2001-03-26 Thread [EMAIL PROTECTED]

Hello,

I want to read lines from a file between !--begin-- And !--End--

Can someon help me.

Walter



Re: [PHP-DB] Read lines

2001-03-26 Thread Felix Kronlage

On Mon, Mar 26, 2001 at 12:38:38PM +0200, [EMAIL PROTECTED] wrote:

don't know why this is on php-db

 I want to read lines from a file between !--begin-- And !--End--

read the file line by line, match every line with a regexp. 
If you hit the line !--begin-- start stuffing the lines in array.
Once you hit the line !--End-- stop reading the file, close it and
your have every line in between in an array. should do the job just
fine.

-fkr
-- 
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0 
  |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
  |all your base are belong to us  |  shame on me  | fkr@IRCnet | 

 PGP signature


Re: [PHP-DB] Read lines

2001-03-26 Thread [EMAIL PROTECTED]

First Thx for your response

I don't think you know wat i mean.

My brother give me a HTML file. I must place a menu from a DB but
Then i must have the folowing code

!--begin_menu--
  tr
tdmenu/td
  /tr
!--end_menu--

So i must read from !--begin_menu-- till !--end_menu--.



- Original Message - 
From: Ben Cairns [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, March 26, 2001 12:34 PM
Subject: RE: [PHP-DB] Read lines


 HTH...
 
 ?
 $file = "YOUR URL/FILE HERE";
 $open = fopen($file, "r");
 $search = fread($open, FILE SIZE IN BYTES);
 fclose($open);
 $news[1] = str_replace("replace this, "with this", $grabbed[1]);
 ?
 
 ?
 echo $grabbed[1]
 ?
 
 -- Ben Cairns - Head Of Technical Operations
 intasept.COM
 Tel: 01332 365333
 Fax: 01332 346010
 E-Mail: [EMAIL PROTECTED]
 Web: http://www.intasept.com
 
 "MAKING sense of
 the INFORMATION
 TECHNOLOGY age
 @ WORK.."
 
 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]