Connecting Tech Pros Worldwide Help | Site Map

PHP Fatal error: Cannot use string offset as an array

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 4th, 2006, 08:45 PM
Jim Michaels
Guest
 
Posts: n/a
Default PHP Fatal error: Cannot use string offset as an array

[19] => Array
(
[tag] => UML:CLASS
[type] => open
[level] => 5
[attributes] => Array
(
[XMI.ID] => .:00000000000008EC
[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\argouml2sql.php on line 32

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


what am I doing wrong?



  #2  
Old March 4th, 2006, 08:45 PM
Jim Michaels
Guest
 
Posts: n/a
Default Re: PHP Fatal error: Cannot use string offset as an array


"Jim Michaels" <NOSPAMFORjmichae3@yahoo.com> wrote in message
news:L8udndm2vp5Xm5fZRVn-jg@comcast.com...[color=blue]
> [19] => Array
> (
> [tag] => UML:CLASS
> [type] => open
> [level] => 5
> [attributes] => Array
> (
> [XMI.ID] => .:00000000000008EC
> [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\argouml2sql.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'];



 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.