/home/mjc1/public_html/otms_old/1_old.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
include("./_common.php");

$loginurl "http://api.11st.co.kr/rest/cateservice/category/2878";

$xml1 "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<ns2:categorys >
    <ns2:category>
        <depth>1</depth><dispNm>여행/숙박/항공</dispNm><dispNo>2878</dispNo><engDispYn>N</engDispYn><gblDlvYn>N</gblDlvYn><parentDispNo>0</parentDispNo><requiredYn>N</requiredYn>
    </ns2:category>
</ns2:categorys>"
;

//$xml = curl_call_get($loginurl);
$xml2 "<?xml version=\"1.0\" encoding=\"EUC-KR\"?>
<ns2:cate>
    <ns2:category>
        <depth2>1</depth2><dispNo>한글</dispNo>
        <engDispYn>N</engDispYn>
        <gblDlvYn>N</gblDlvYn>
        <parentDispNo>0</parentDispNo>
        <requiredYn>N</requiredYn>
    </ns2:category>
    <ns2:category>
        <depth2>1</depth2><dispNo>2878</dispNo>
        <engDispYn>N</engDispYn>
        <gblDlvYn>N</gblDlvYn>
        <parentDispNo>0</parentDispNo>
        <requiredYn>N</requiredYn>
    </ns2:category>
</ns2:cate>
"
;

$xml iconv("euckr","utf-8",$xml);
$xml str_replace("encoding=\"euc-kr\"","encoding=\"utf8\"",$xml);

$json json_encode(new SimpleXMLElement($xml1));
//$result =  json_decode($json, true);

_pr($json);


?> 
<textarea style='width:600px; height:300px;'><?php echo $xml1;?></textarea>
<!--<textarea style='width:100%; height:600px;'><?php echo $json;?></textarea>-->