|
Posted by thib΄ on 01/14/08 00:58
Peter Pei wrote:
> 1)your sample won't work, at least not with php's current shape.
> 2) Of course it's <possible>, is it possible, or a definite yes. be precise
>
1) Ah?
<?php
session_start();
$_SESSION[] = array('why', 'wouldn\'t', 'this', 'work?');
echo '<pre>' . print_r($_SESSION, true) . '</pre>';
?>
outputs:
Array
(
[0] => Array
(
[0] => why
[1] => wouldn't
[2] => this
[3] => work?
)
)
Well, I must admit, I got a notice here:
Notice: Unknown: Skipping numeric key 0. in Unknown on line 0
By defining a non-numeric key for the array, it doesn't display this notice,
so I guess $_SESSION have special rules (I'm not that familiar with it)
until a 'normal' array will accept this code very well (I don't see any
glitch in $_SESSION neither).
2) I'm sorry, I must have missed something. I'm aware my English is not
perfect at all, maybe the literal translation hasn't the same meaning in
French and in English, or whatever; I'm frustrated I don't get what you
mean. Anyway, what I meant is "Definitely yes, it's possible to use arrays
in sessions".
-thibΒ΄
Navigation:
[Reply to this message]
|