제목 | print_r 의 변형 함수 | ||
---|---|---|---|
글쓴이 | 이지포토 | 작성시각 | 2012/11/30 11:32:07 |
|
|||
처음으로 팁을 올려 봅니다. if ( ! function_exists('_print_r')) { function _print_r($_REQUEST,$exit=1) { //사용법, array, 정지=1 if(getenv("REMOTE_ADDR")=="127.0.0.1" || getenv("REMOTE_ADDR")=="192.168.0.135" || getenv("REMOTE_ADDR")=="222.112."){ if($exit==1){ echo "<pre>"; print_r($_REQUEST); echo "</pre>"; //exit; }else{ echo "<pre>"; print_r($_REQUEST); echo "</pre>"; } } } } 출력할때 비교입니다.(샘풀) var_dump($data); array(12) { ["page"]=> int(1) ["args"]=> string(23) "s_text=&s_option=&news=" ["s_text"]=> NULL ["s_option"]=> NULL ["kcb_subject"]=> string(12) "지사공통" ["table_width"]=> string(5) "100%%" ["main_content"]=> string(36) "kcbskin/branchmemo/kcboard_list_view" ["data_totalcount"]=> int(1) ["paging_data"]=> array(11) { ["first"]=> int(1) ["pagesize"]=> int(9) ["prev"]=> int(1) ["start"]=> int(1) ["end"]=> int(1) ["page"]=> int(1) ["next"]=> int(1) ["last"]=> int(1) ["total"]=> int(1) ["iend"]=> int(1) ["istart"]=> int(1) } ["pagination_links"]=> string(29) " 1 " ["data_lists"]=> array(1) { [0]=> array(33) { ["bw_id"]=> string(1) "5" ["acode"]=> string(2) "DJ" ["bcode"]=> string(2) "02" ["bw_category_name"]=> NULL ["bw_parentid"]=> print_r($data); Array ( [page] => 1 [args] => s_text=&s_option=&news= [s_text] => [s_option] => [kcb_subject] => 지사공통 [table_width] => 100%% [main_content] => kcbskin/branchmemo/kcboard_list_view [data_totalcount] => 1 [paging_data] => Array ( [first] => 1 [pagesize] => 9 [prev] => 1 [start] => 1 [end] => 1 [page] => 1 [next] => 1 [last] => 1 [total] => 1 [iend] => 1 [istart] => 1 ) [pagination_links] => 1 [data_lists] => Array ( [0] => Array ( [bw_id] => 5 [acode] => DJ [bcode] => 02 [bw_category_name] => [bw_parentid] => 1 [bw_childid] => 111 [bw_notice] => [bw_html] => N [bw_secret] => N [bw_receive_email] => N [bw_title] => ㅅㄷㄴㄴ [bw_content] => ㅅㄷㄴㅅㄴㄴ [bw_readed] => 8 _print_r($data); //이것이 제가 만든 함수에서 토해내는 배열형태 Array ( [page] => 1 [args] => s_text=&s_option=&news= [s_text] => [s_option] => [kcb_subject] => 지사공통 [table_width] => 100%% [main_content] => kcbskin/branchmemo/kcboard_list_view [data_totalcount] => 1 [paging_data] => Array ( [first] => 1 [pagesize] => 9 [prev] => 1 [start] => 1 [end] => 1 [page] => 1 [next] => 1 [last] => 1 [total] => 1 [iend] => 1 [istart] => 1 ) [pagination_links] => 1 [data_lists] => Array ( [0] => Array ( [bw_id] => 5 [acode] => DJ [bcode] => 02 [bw_category_name] => [bw_parentid] => 1 [bw_childid] => 111 [bw_notice] => [bw_html] => N [bw_secret] => N [bw_receive_email] => N [bw_title] => ㅅㄷㄴㄴ .... 중략 .. |
|||
다음글 | hook 을 이용한 layout 설정하기 (2) | ||
이전글 | INDEX를 이용한 랜덤 정렬 (4) | ||
한대승(불의회상)
/
2012/11/30 16:04:58 /
추천
0
출력되는 모양이 아주 깔끔 합니다. ^^
|