<?php
$file = "tpllib/article_list.php";
$str = file($file);
$count = count($str);
//函数 count
for ($i=0;$i<$count;$i++){
$str[$i] = trim($str[$i]);
if($str[$i] == '$start = $start + 50;'){
$j = $i-1;
preg_match('/\$start = (.*);/',$str[$j],$match);
$now = $match[1]+30;
$str[$j] = '$start = '.$now.';';
}
}
foreach($str as $val){
$content .= $val."\n";
}
$fp = fopen($file, 'w+');
if ($fp) {
fwrite($fp, $content);
fclose($fp);
}
;?>