페이징 함수 이점과 이후에 코드를 추가할수 있는 함수 추가

page_insertbefore()
page_insertafter()
This commit is contained in:
gnuboard
2013-01-25 16:33:54 +09:00
parent d7e5f1524e
commit 46d137f099
3 changed files with 23 additions and 5 deletions

View File

@ -51,6 +51,21 @@ function get_paging($write_pages, $cur_page, $total_page, $url, $add="")
return "";
}
// 페이징 코드의 <div><span> 태그 다음에 코드를 삽입
function page_insertbefore($paging_html, $insert_html)
{
if ($paging_html) {
return preg_replace("/^(<div[^>]+><span[^>]+>)/", '$1'.$insert_html, $paging_html);
}
}
// 페이징 코드의 </span></div> 태그 이전에 코드를 삽입
function page_insertafter($paging_html, $insert_html)
{
if ($paging_html) {
return preg_replace("/(<\/span><\/div>)$/", $insert_html.'$1', $paging_html);
}
}
// 변수 또는 배열의 이름과 값을 얻어냄. print_r() 함수의 변형
function print_r2($var)