Jump to content
php.lv forumi

Dabūt vērtību no salikta Array - Notice: Undefined offset


Bunkertor 7

Recommended Posts

variablis $MyArray satur saliktu Array pār kuru man nav nekādas kontroles.

Principā tas Array izskatās šādi:

 

Array ( [Dimensija 1] => Array ( [platums] => 291,5 [garums] => 19,2 ) [Dimensija 2] => Array ( [platums] => 275,7 [garums] => 20,5 ) ) 

 

Man vajag otrā apakš-Arraya pirmo elementu (otrās dimensijas platumu). Biju pilnīgi pārliecināts, ka tas iegūstams šādi:

 

echo $MyArray[1][0];

 

Rezultāts ir: Notice: Undefined offset: 1

 

Kā tad lai es viņu savādāk definēju?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...