" ) { echo $buf."
"; $buf = fgets( $f, 1024 ); $buf = fgets( $f, 1024 ); echo $buf."
"; $arr = split( "[%(:)-]", trim( $buf ) ); $Perc = $arr[ 0 ]; $Beg = $arr[ 2 ]; $End = $arr[ 3 ]; echo "perc ".$Perc." beg ".$Beg." end ".$End."
"; $buf = fgets( $f, 1024 ); $buf = fgets( $f, 1024 ); echo $buf."
"; $shf1 = strspn( $buf, " " ); $shf2 = strcspn( substr( $buf, $shf1 ), " " ); $arr = split( "[ +]", trim( $buf ) ); $Beg2 = $arr[ 0 ]; echo "shf1 ".$shf1." shf2 ".$shf2." Beg2 ".$Beg2."
"; $buf = fgets( $f, 1024 ); $buf = fgets( $f, 1024 ); $buf = fgets( $f, 1024 ); $name = split( "[ +]", $buf ); $str = trim( substr( $buf, $shf1+$shf2+( $Beg - $Beg2 ) - 1 ) ); while( $buf = fgets( $f, 1024 ) ) { if( $buf[0] == ">" ) break; if( !strcmp( substr( $buf, 0, strlen( $name[ 0 ] ) ), $name[ 0 ] ) ) { $arr = split( "[ +]", trim( $buf ) ); $str .= $arr[ 1 ]; } } echo $str."
"; echo strlen( $str )."
"; $beg[ 0 ] = 0; $i = 0; while( 1 ) { $len[ $i ] = strcspn( $str, "-" ); $str = substr( $str, $len[ $i ] ); if( $str != "" ) { $gap = strcspn( $str, "-" ); $i++; $beg[ $i ] = $beg[ $i-1 ] + len[ $i-1 ] + $gap; $str = substr( $str, $gap ); } else break; } for( $i = 0; $i < count( $beg ); $i++ ) echo $beg[ $i ]." ".$len[ $i ]."
"; } else { $buf = fgets( $f, 1024 ); } } #$arr = split( "[ ]+", $buf2 ); ?>