Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Quote Originally Posted by Excellent1 View Post
    Arrays are handy but you don't always need them.
    You could use something as simple as:

    PHP Code:
    $name1 "Bob";
    $name2 "Marley";
    echo (
    ' $name1 '); 
    But stick to arrays as it will be the most professional way of doing things.
    First of all that wouldnt work as you'd have to use double quotes

    echo( '$name' ); // "$name"
    echo( $name ); // "Bob"
    echo( "$name" ); // "Bob"
    Hi, names James. I am a web developer.

  2. #12
    Join Date
    May 2008
    Posts
    605
    Tokens
    0

    Default

    Quote Originally Posted by Protege View Post
    First of all that wouldnt work as you'd have to use double quotes

    echo( '$name' ); // "$name"
    echo( $name ); // "Bob"
    echo( "$name" ); // "Bob"
    My bad, waiting on Hypertext to come in talking about parenthesis now :rolleyes:

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

    Latest Awards:

    Default

    Quote Originally Posted by Excellent1 View Post
    Arrays are handy but you don't always need them.
    You could use something as simple as:

    PHP Code:
    $name1 "Bob";
    $name2 "Marley";
    echo (
    ' $name1 '); 
    But stick to arrays as it will be the most professional way of doing things.
    Why are you using quotes to echo a variable?!

    PHP Code:
    echo (' $name1 '); 
    The way..
    PHP Code:
    echo $name1;
    // OR IF YOUR FANCY
    echo( $name1 ); 

  4. #14
    Join Date
    May 2008
    Posts
    605
    Tokens
    0

    Default

    Quote Originally Posted by Calon View Post
    Why are you using quotes to echo a variable?!

    PHP Code:
    echo (' $name1 '); 
    The way..
    PHP Code:
    echo $name1;
    // OR IF YOUR FANCY
    echo( $name1 ); 
    Personal preference of my coding

  5. #15
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Personal preference of my coding
    Using parenthesis' with language constructs doesn't bother me, but putting variables in quotes does

  6. #16
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    yeah, Its really confusing once you start going "$thisvar is like $great2thisvar and $that"

    That confuses the **** into me lols

    $thisvar . ' is like ' . $great2thisvar . ' and ' . $that

    HyperText: 'TEH FIRSTZ RULEZ OF CODIGNZZ IS NOT TO PUT PARENTTHISTISZ ON A NON-FUNCTZIONZ OKIA??? ITS BAIDZ AND IT MIAKIS ME MADDD'
    Last edited by Protege; 24-08-2008 at 12:53 AM.
    Hi, names James. I am a web developer.

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
  •