Re: parse text

From: Date: Wed, 19 Jun 2002 10:07:53 +0000
Subject: Re: parse text
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-102905@lists.php.net to get a copy of this message
At a guess, without trying it out $fp = fopen("your file") or echo "Cant open your file"; $tmp = fread($fp,1024); preg_match("/(.{8}).(.{5})/",$tmp,$matches); then $matches[1] will have the first part and $matches[2] will have the second note: $matches[0] = whole preg'd text "Sonjaya" <sonjaya@che.itb.ac.id> wrote in message news:000301c21763$2c10b9d0$c800a8c0@sicute... > i want read some tex like this > > here contens file text > > 1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ > > > 1. i want read from first left until eight caracter (12345678 <-- > caracter i cant read ) > it can be use fread > 2. i want read 5 from nine (9) caracter from left ( 0ABCD <--the > caracter must i read ) > so anybody can help me >

« previous php.general (#102905) next »