file - How to get a column and line from textfile. php/html -
if have textfile called text.txt, inside textfile @ column 2 line 6 there 1 word "help" how read word , print out php/html?
with html impossible. need use php or other language.
using php
<?php $arr = file ("text.txt"); substr($arr[5],2,4); ?>
or if want exact word found.
<?php $arr = file ("text.txt"); preg_match('/help/', $arr[5], $matches); print_r($matches); ?>
http://php.net/manual/en/function.substr.php
Comments
Post a Comment