過濾全文驗證正則表達式的一個小程序

mode變量用來填寫正則表達式
php

/opt/datafile是目標數據文件正則表達式



#!/usr/bin/phpide

<?phpspa


$mode="/tom/";get

$fp=fopen('/opt/datafile','r');string


while(!feof($fp)){it

$string=fgets($fp);class

#echo $string.chr(10);變量


if (preg_match($mode,$string)){file

echo $string;

}


}

?>

相關文章
相關標籤/搜索