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!


Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Dec 2005
    Location
    Mank-Chest-Hair
    Posts
    4,039
    Tokens
    2,266

    Latest Awards:

    Default

    I am putting the values myself yep.
    Could I please ask why is it better to use
    <?php echo $variableOne; ?>
    instead of
    <?= $rangeba4 ?>

    Thanks.

  2. #12
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by ksoz View Post
    I am putting the values myself yep.
    Could I please ask why is it better to use
    <?php echo $variableOne; ?>
    instead of
    <?= $rangeba4 ?>

    Thanks.
    Haha sorry it's not better I'm not even sure if shorter variable names make it faster haha. I never looked into it.

    Right okay, if you are putting the values in yourself and displaying them, you mayaswell not define the variables at all.

    Just do

    PHP Code:
    <?php
    echo 'value';
    ?>
    where u want the value to go. Rather than putting the variable as value and then echoing the variable. If you get me ?

  3. #13
    Join Date
    Dec 2005
    Location
    Mank-Chest-Hair
    Posts
    4,039
    Tokens
    2,266

    Latest Awards:

    Default

    I understand but I am doing it for my site where I need to show the same value alot in different places. And its easier to have it as a variable because then if I change it, it changes all of them at once

  4. #14
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by ksoz View Post
    I understand but I am doing it for my site where I need to show the same value alot in different places. And its easier to have it as a variable because then if I change it, it changes all of them at once
    Ahh see I didn't know you were doing this

    Yehh it won't slow it down that much. I'm trying to think whether an array would be appropriate, but it'll be too hard to grasp....

    Also, since your new to php, when you want to display variables after each other you can do:

    PHP Code:
    echo $variable.$variable2.$variable3
    The . is ownage.

  5. #15
    Join Date
    Dec 2005
    Location
    Mank-Chest-Hair
    Posts
    4,039
    Tokens
    2,266

    Latest Awards:

    Default

    Thank you

  6. #16
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    About the naming, it just makes it easier to name things for what they are for.

    For example, $username for username, $password for password.

    PHP Code:
    $site_name "TestSite!";
    $site_slogan "We're a test site!"
    That's better then using:

    PHP Code:
    $wsdfsdlj "TestSite!";
    $esskldfjs "We're a test site!"
    Then if you want to echo them out, just do:

    PHP Code:
    <?php echo $site_name?>

Page 2 of 2 FirstFirst 12

Posting Permissions

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