$total_count 을 어떻게 구할수있을까요? > 그누3질답

그누3질답

$total_count 을 어떻게 구할수있을까요? 정보

그누보드 $total_count 을 어떻게 구할수있을까요?

본문

한폴드안에서 전체이미지를 구할때 $total_count 을 어떻게 구할수있을까요?
페이지를 나누고싶어서 입니다.
<?
$d = dir("./data/file/$bo_table/");
while ($entry = $d->read()) {
    if(eregi(".jpg|.gif",$entry)) {
        $imagefile = "./data/file/$bo_table/$entry";
        $size += filesize($imagefile);
        $idx = filectime($imagefile);
        // 배열 첨자
        $image["$idx$entry"] = $entry;
    }
}

?>



<?

if (count($image)) {
    krsort($image);

$total_count = $key;
$rows=10;
$total_page  = ceil($total_count / $rows);
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page == "") $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $rows;
?>

댓글 전체

혹시 이런걸 원하나요...

<?

$image = array();
$d = dir("./data/file/$bo_table");

while (false !== ($entry = $d->read())) {
   
    if(eregi(".jpg|.gif",$entry)) {
        $imagefile = "./data/file/$bo_table/$entry";
        $size += filesize($imagefile);
        $idx = filectime($imagefile);
       
        // 배열 첨자
        $image["$idx$entry"] = $entry;
    }
   
}
$d->close();

$rows = 10;
$total_count = count($image);

if ($total_count > 0) { krsort($image); }

$total_page  = ceil($total_count / $rows);

// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page == "") $page = 1;

// 시작 레코드 구함
$from_record = ($page - 1) * $rows;

?>
전체 9,564
그누3질답 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT