|
|
|
ค้นหา text ใน text.file แล้วแสดง ตำแหน่งของ line ค่ะ |
|
|
|
|
|
|
|
Code (PHP)
$line_text = file('test.txt');
foreach( $line_text as $line_num=>$text){
if( strpos($text, 'abcedf') !== false ){
echo $line_num+1,'<br>';
}
}
|
|
|
|
|
Date :
2015-12-24 03:51:56 |
By :
NewbiePHP |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2015-12-25 21:43:18 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|