인코딩이 ms949일때

PHP - (ajax) - javascript

 보낼때 - encodeURIComponent(category_name)
 받을때 - $category_name = iconv("UTF-8", "CP949", rawurldecode($_POST[category_name]));

javascript - (ajax) - php
 보낼때 - rawurlencode(iconv("CP949", "UTF-8", "한글"))
 받을때 - 
decodeURIComponent(data.category_name.Text);
$arr = array();

$obj["a"] = 1;
$obj["b"] = 2;
array_push($arr, $obj);

$obj["a"] = 9;
$obj["b"] = 0;
array_push($arr, $obj);

for( $i=0; $i<count($arr); $i++ ){
	echo "<br />arr[".$i."] a : " . $arr[$i]["a"];
	echo "<br />arr[".$i."] a : " . $arr[$i]["b"];
}
-------------------------------------------------------------------------
$sql = "select seq,title,content,file_ori,hit,regdate,file_phy from php_test order by seq desc limit 10";
$rs = mysql_query($sql, $connect);

$list = array();
while( $row = mysql_fetch_object( $rs ) ){
	$map;
	foreach( $row as $key => $data ){		
		$map[$key] = $row[$key];		
	}
	array_push($list, $map);
}

for( $i=0; $i<count($list); $i++ ){
	echo ( "" );
	echo ( "	". $list[$i][seq]  . "" );
	echo ( "	". $list[$i][title]  . "" );	
	echo ( "	". substr($list[$i][regdate], 0, 10)  . "" );
	echo ( "	". $list[$i][hit]  . "" );
	echo ( "" );
}
echo("==================== printParameter ====================
");
foreach( $_REQUEST as $key => $data ){
	if( strlen($key) < 20 && $key != "PHPSESSID" ){
		echo("==== " . $key . " : " . $data . "
"); } } echo("==================== printParameter ==================== ");

+ Recent posts