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

http://php.net/manual/pl/function.file.php

http://pl1.php.net/manual/en/function.preg-match.php


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -