This is a discussion on how insert value inner array within the alt.comp.lang.php forums, part of the PHP Programming Forums category; if this work $var0['list'] = array( 'type1' => 'val1', 'type2' => 'val2', 'type3' => 'val3' ); is possible to have this: $...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
On 29 Apr, 12:16, nawfer <novalidsfors...@alt.al> wrote:
> if this work > $var0['list'] = array( > 'type1' => 'val1', > 'type2' => 'val2', > 'type3' => 'val3' > ); > > is possible to have this: > $var0['list'] = array( > 'type1' => 'val1', > 'type2' => 'type3' => 'val2-3' > ); > > which is correct code ? No - its syntactic and semantic garbage - and you haven't explained what you are trying to acheive. C. |
|
|||
|
nawfer schreef:
> if this work > $var0['list'] = array( > 'type1' => 'val1', > 'type2' => 'val2', > 'type3' => 'val3' > ); The above is valid PHP. > > is possible to have this: > $var0['list'] = array( > 'type1' => 'val1', > 'type2' => 'type3' => 'val2-3' > ); That is invalid. What do you try to accomplish by that? What do you expect the following line will produce: echo $var0['type2']; ??? > > which is correct code ? The former. But as C pointed out, we might be of more help if you describe what you try to store in that array. Regards, Erwin Moller |
|
|||
|
nawfer schrieb:
> is possible to have this: > $var0['list'] = array( > 'type1' => 'val1', > 'type2' => 'type3' => 'val2-3' > ); $var0['list'] = array( 'type1' => 'val1', 'type2' => array( 'type3' => 'val2-3' ) ); Greetings, Thomas -- Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison! (Coluche) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|