Categories:

    String lesson 3

    Strings

    Strings in PHP could be thought of as sentences such as: "I went to the store". Strings differ from variables in that they are a COLLECTION of values in one variable.
    Example:

    $variable = '9';
    $string = 'abcdefghijklmnopqrstuvwxyz';
    ?>

    Stings can be used to store names, tiles, addresses, and all kinds of things. So expect to use them often! Just like variables - you don't need to tell the computer that it is a "string". The computer can tell just by what value you put in it.

    $1 = 0; //var
    $2 = 'Hi'; //string
    $3 = "Fast Monkey"; //string
    $4 = 'K'; //var
    ?>

    I highly recommend you read Codewalkers String Primer.

    0 Responses