Close.  You need to adjust for the length of your pattern.  So if you're
matching against "<!- start ->", then your actual start position (minus the
start comment) is the strpos plus strlen($pattern), or 14 in this case.

$startPos = strpos($file, '<!- start ->') + 14;

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


"Jlake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've been looking around for a bit and can't quite find what I'm looking
to
> do.
>
> I want to read a file (from a pattern matched start position) to (a
pattern
> matched end position)
>
> $startPos = strpos($file, '<!- start ->');
> $endPos = strpos($file, '<!- end ->');
>
> $stuff = fread($file, ($endPos - $startPos));
>
> something like that ?
>
> Thanks,
>
> J.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to