PHP Fatal error: Cannot use string offset as an array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim Michaels

    PHP Fatal error: Cannot use string offset as an array

    [19] => Array
    (
    [tag] => UML:CLASS
    [type] => open
    [level] => 5
    [attributes] => Array
    (
    [XMI.ID] => .:0000000000000 8EC
    [NAME] => quiz_batteries
    [VISIBILITY] => public
    [ISSPECIFICATION] => false
    [ISROOT] => false
    [ISLEAF] => false
    [ISABSTRACT] => false
    [ISACTIVE] => false
    )

    [value] =>

    )

    $xmlarray[$x]['tag']['attributes']['NAME']

    gives me

    C:\prj\quiz>php argouml2sql.php quiz.xmi
    PHP Fatal error: Cannot use string offset as an array in
    C:\prj\quiz\arg ouml2sql.php on line 32

    I also get the same error on
    $id=$xmlarray[$x]['tag']['attributes']['XMI.ID'];


    what am I doing wrong?


  • Jim Michaels

    #2
    Re: PHP Fatal error: Cannot use string offset as an array


    "Jim Michaels" <NOSPAMFORjmich ae3@yahoo.com> wrote in message
    news:L8udndm2vp 5Xm5fZRVn-jg@comcast.com. ..[color=blue]
    > [19] => Array
    > (
    > [tag] => UML:CLASS
    > [type] => open
    > [level] => 5
    > [attributes] => Array
    > (
    > [XMI.ID] => .:0000000000000 8EC
    > [NAME] => quiz_batteries
    > [VISIBILITY] => public
    > [ISSPECIFICATION] => false
    > [ISROOT] => false
    > [ISLEAF] => false
    > [ISABSTRACT] => false
    > [ISACTIVE] => false
    > )
    >
    > [value] =>
    >
    > )
    >
    > $xmlarray[$x]['tag']['attributes']['NAME']
    >
    > gives me
    >
    > C:\prj\quiz>php argouml2sql.php quiz.xmi
    > PHP Fatal error: Cannot use string offset as an array in
    > C:\prj\quiz\arg ouml2sql.php on line 32
    >
    > I also get the same error on
    > $id=$xmlarray[$x]['tag']['attributes']['XMI.ID'];
    >
    >
    > what am I doing wrong?
    >[/color]
    figured it out.
    $xmlarray[$x]['attributes']['NAME']
    $id=$xmlarray[$x]['attributes']['XMI.ID'];



    Comment

    Working...