You are here: Re: Use of session variables « PHP Programming Language « IT news, forums, messages
Re: Use of session variables

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]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация