|
|
|
ใครอ่าน getAttribute ใน tag XML แบบนี้บ้างครับ <manifest android:versionCode="7" > |
|
|
|
|
|
|
|
ไม่ได้คัรบ
Code (PHP)
$xmlfile = '685apk.xml';
$xmlparser = xml_parser_create();
// open a file and read data
$fp = fopen($xmlfile, 'r');
$xmldata = fread($fp, 4096);
xml_parse_into_struct($xmlparser,$xmldata,$values);
xml_parser_free($xmlparser);
for($i=0;$i<sizeof($values);$i++)
{
print_r($values[$i]);
echo "<br>";
//if($values[$i]['attributes']=="XMLNS:ANDROID" && $values[$i]['level']==8){
echo $values['attributes']['XMLNS:ANDROID'];
//}
}
ใช้ตัวนี้อ่าน array มันมาได้ละครับ
แต่คิดเงื่อนไขที่จะดึง Array attributes ไม่ออก
Array ( [tag] => MANIFEST [type] => open [level] => 1 [attributes] => Array ( [XMLNS:ANDROID] => http://aaaaaa.android.com/apk/res/android [ANDROID:VERSIONCODE] => 7 [ANDROID:VERSIONNAME] => 1.1 [PACKAGE] => com.aaaaaaa.movieguide ) [value] => )
Array ( [tag] => SUPPORTS-SCREENS [type] => complete [level] => 2 [attributes] => Array ( [ANDROID:ANYDENSITY] => true [ANDROID:SMALLSCREENS] => true [ANDROID:NORMALSCREENS] => true [ANDROID:LARGESCREENS] => true [ANDROID:RESIZEABLE] => true ) [value] => )
|
|
|
|
|
Date :
2011-08-10 09:43:24 |
By :
ckcr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
array ( '[tag]' => 'MANIFEST',
'[type]' => 'open',
'[level]' => 1,
'[attributes]' => array (
'[XMLNS:ANDROID]' => 'http://aaaaa.android.com/apk/res/android',
'[ANDROID:VERSIONCODE]' => 7,
'[ANDROID:VERSIONNAME]' => 1.1,
'[PACKAGE]' => 'com.aaaaaa.movieguide' )
)
ถ้าต้องให้แสดงค่า PACKAGE
echo ไงครับ
|
ประวัติการแก้ไข 2011-08-10 11:34:12
|
|
|
|
Date :
2011-08-10 11:05:28 |
By :
ckcr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
แบบนี้ครับ
Code (PHP)
<?php
$arr = array ( '[tag]' => 'MANIFEST',
'[type]' => 'open',
'[level]' => 1,
'[attributes]' => array (
'[XMLNS:ANDROID]' => 'http://aaaaa.android.com/apk/res/android',
'[ANDROID:VERSIONCODE]' => 7,
'[ANDROID:VERSIONNAME]' => 1.1,
'[PACKAGE]' => 'com.aaaaaa.movieguide' )
);
echo $arr['[attributes]']['[PACKAGE]'];
?>
*ไปเอา manifest ของ android มาเช็คทำไมเหรอครับ
|
|
|
|
|
Date :
2011-08-10 15:18:36 |
By :
peterxp |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
API ครับ
|
ประวัติการแก้ไข 2011-08-11 16:17:53
|
|
|
|
Date :
2011-08-10 20:31:06 |
By :
ckcr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|