1

私のコードでは、xml (以前は svg) ファイルからパス データを取得しようとしていますが、$attributes 配列によってデータを正常に出力できますが、echo を使用すると、「メンバーへの呼び出し」が引き続き表示されます。 (136 行目と 156 行目) の非オブジェクトの関数 attributes() では、コードの何が問題なのかわかりませんが、最悪の場合のシナリオでは、選択したデータをデータベース内のデータベースに挿入するハックをいつでも使用できます。 while ループを繰り返して目的のページに進む... 自分のコードの何が問題なのか疑問に思っています. エコー コマンドを使用して正しい情報をエコーアウトします. オブジェクト以外のエラーでメンバー関数を呼び出すだけです.

while($number_of_array_path >=1)
{
//declares attributes based on path number for sodipodi attributes line136
$attributes = $xml_file_open->g->path[$path_incremental_counter]-
>attributes('sodipodi', true); 

//sets each attribute within an array and uses the path incremental counter for 
//that pourpose.
$type_array[$path_incremental_counter] = $attributes['type'];
$cx_array[$path_incremental_counter] = $attributes['cx'];
$cy_array[$path_incremental_counter] = $attributes['cy'];
$rx_array[$path_incremental_counter] = $attributes['rx'];
$ry_array[$path_incremental_counter] = $attributes['ry'];
echo $type_array[$path_incremental_counter];
echo "<br/>";                               
echo $cx_array[$path_incremental_counter];
echo "<br/>";                               
echo $cy_array[$path_incremental_counter];
echo "<br/>";
echo $rx_array[$path_incremental_counter];
echo "<br/>";
echo $ry_array[$path_incremental_counter];
echo "<br/>";                               


//same as above but for non"sodipodi" attributes. line 156
$attributes = $xml_file_open->g->path[$path_incremental_counter]->attributes();
// echo $attributes['id'];  
$style_array[$path_incremental_counter] = $attributes['style'];
$id_array[$path_incremental_counter] = $attributes['id'];
$d_array[$path_incremental_counter] = $attributes['d'];
echo $style_array[$path_incremental_counter];
echo "<br/>";
echo $id_array[$path_incremental_counter];
echo "<br/>";
echo $d_array[$path_incremental_counter];
echo "<br/>";



//increments path incremental counter
$path_incremental_counter = $path_incremental_counter + 1;
//decrements number of array path
$number_of_array_path = $number_of_array_path;                                                              
}
4

1 に答える 1

0
foreach($xml_file_open->g->path[$shape_path_iteration_counter]->attributes() 
as $attribute => $value)

非 sodipodi 要素の場合

foreach($xml_file_open->g->path[$shape_path_iteration_counter]->
attributes('sodipodi', true) as $attribute => $value)

ソディポディ要素用。

于 2012-05-20T05:33:03.707 に答える