Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 6 of 6

Thread: PHP Help

  1. #1
    Join Date
    Mar 2006
    Posts
    131
    Tokens
    0

    Default PHP Help

    Hey,
    I am not sure if this is possible however,
    For example if I had a variable set to the number 14

    Is it possible for me to change that just to the number 1, so get rid of the second digit?

    Thanks

  2. #2
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Don't think that it is possible, I think you can update numbers etc in sessions, if not just use MySQL?

  3. #3
    Join Date
    Nov 2007
    Posts
    1,253
    Tokens
    150

    Latest Awards:

    Default

    I don't quite get at what you want? You could always just substring it to keep the first number or something, although I'm pretty sure there is another function that will do that.

    PHP Code:

    $varName 
    14;
    $varName substr$varName0); 


    www.fragme.co = a project.

  4. #4
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Source View Post
    I don't quite get at what you want? You could always just substring it to keep the first number or something, although I'm pretty sure there is another function that will do that.

    PHP Code:

    $varName 
    14;
    $varName substr$varName0); 
    He wants to update a variable

  5. #5
    Join Date
    Mar 2006
    Posts
    131
    Tokens
    0

    Default

    Magic, thats excactly what i was after

    Thank you very much

    I can't give you Rep atm says i need to spread, i shall rep you when it lets me. Thanks
    Last edited by Pixzo; 06-10-2008 at 02:55 PM.

  6. #6
    Join Date
    Oct 2008
    Location
    England
    Posts
    46
    Tokens
    0

    Default

    Although you've already been answered, next time try and go into some detail, I thought you wanted a script which would change all number var's into a single-diget, removing the second digit, not replacing vars.

    Money sent via Paypal. Lowest payout $2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •