FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » simple session question
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: simple session question [message #175697 is a reply to message #175696] Fri, 21 October 2011 18:51 Go to previous messageGo to previous message
Jonathan Stein is currently offline  Jonathan Stein
Messages: 43
Registered: September 2010
Karma:
Member
Den 21-10-2011 20:19, Thomas Mlynarczyk skrev:

>> case 0: $_SESSION['stp'] = $_SESSION['stp']++;

With ++ after the variable, it is increased AFTER it has been used for
the calculation. So this happens:

1) The value of "$_SESSION['stp']++" is calculated. (Result: 0)

2) $_SESSION['stp'] is increased.

3) $_SESSION['stp'] is assigned the previously calculated value (zero).

It should work with ++$_SESSION['stp'], but still it's redundant to
assign the value of a variable to itself.

- And then the solution presented by Thomas is still far more elegant.

Regards

Jonathan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: session cookie: client side
Next Topic: by get this format my explode file name like this through php
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 28 14:55:31 GMT 2024

Total time taken to generate the page: 0.05226 seconds