2016-12-16 2 views
0

와 개체 변수에 액세스하는 방법 내가 얻을 필요가 : attributes->id객체에서 @Before

SimpleXMLElement Object 
(
    [@attributes] => Array 
     (
      [id] => 30 
      [field_type] => text 
      [base_type] => text 
     ) 

    [label] => Service 
    [nowrap] => 0 
    [bold] => 0 
    [required] => 0 
    [appears_by_default] => 1 
    [find_enabled] => 1 
    [allow_new_choices] => 0 
    [sort_as_given] => 1 
    [carrychoices] => 1 
    [foreignkey] => 0 
    [unique] => 0 
    [doesdatacopy] => 1 
    [fieldhelp] => SimpleXMLElement Object 
     (
     ) 

    [num_lines] => 1 
    [maxlength] => 0 
    [append_only] => 0 
    [allowHTML] => 0 
) 
+0

'$ 개체 ->의 getAttribute ('ID')' – Barmar

+0

$ AT & T는 = "ID를"; $ id = (string) $ field-> attributes() -> $ att; –

답변

0
$att = "id"; 
$fids[] = (string)$field->attributes()->$att;