POST 배열에 mysql_real_escape_string를 적용하기 위해서는 아래처럼 작성을 합니다.
$_POST = array_map("mysql_real_escape_string", $_POST);
그런데 POST 배열안에 또 배열이 있을 경우 mysql_real_escape_string 함수에서 에러가 발생하죠.
이런 경우에 사용하기 위해 만들어본 함수입니다.
$_POST = array_map("mysql_real_escape_string", $_POST);
그런데 POST 배열안에 또 배열이 있을 경우 mysql_real_escape_string 함수에서 에러가 발생하죠.
이런 경우에 사용하기 위해 만들어본 함수입니다.
function array_add_callback($func, $array)
{
if(!$func) {
return;
}
if(is_array($array)) {
foreach($array as $key => $value) {
if(is_array($value)) {
$array[$key] = array_add_callback($func, $value);
} else {
$array[$key] = call_user_func($func, $value);
}
}
} else {
$array = call_user_func($func, $array);
}
return $array;
}
사용자가 직접 적용할 함수를 지정해 줄 수 있어 다양한 경우에 사용할 수 있을 것이라 생각됩니다.
사용자가 직접 적용할 함수를 지정해 줄 수 있어 다양한 경우에 사용할 수 있을 것이라 생각됩니다.
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5102 | 12년 전 | 3461 | ||
| 5101 | 12년 전 | 2506 | ||
| 5100 |
senseme
|
12년 전 | 1833 | |
| 5099 |
senseme
|
12년 전 | 1529 | |
| 5098 |
senseme
|
12년 전 | 1519 | |
| 5097 |
senseme
|
12년 전 | 1276 | |
| 5096 |
senseme
|
12년 전 | 1671 | |
| 5095 |
senseme
|
12년 전 | 1355 | |
| 5094 |
senseme
|
12년 전 | 2413 | |
| 5093 |
senseme
|
12년 전 | 1608 | |
| 5092 |
senseme
|
12년 전 | 2219 | |
| 5091 |
senseme
|
12년 전 | 2102 | |
| 5090 |
senseme
|
12년 전 | 1743 | |
| 5089 |
senseme
|
12년 전 | 4518 | |
| 5088 |
senseme
|
12년 전 | 2665 | |
| 5087 |
senseme
|
12년 전 | 2818 | |
| 5086 |
senseme
|
12년 전 | 1229 | |
| 5085 |
senseme
|
12년 전 | 8502 | |
| 5084 |
senseme
|
12년 전 | 3310 | |
| 5083 |
senseme
|
12년 전 | 2654 | |
| 5082 |
senseme
|
12년 전 | 5304 | |
| 5081 |
senseme
|
12년 전 | 3377 | |
| 5080 | 12년 전 | 13279 | ||
| 5079 | 12년 전 | 3881 | ||
| 5078 | 12년 전 | 1454 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기