Host Speech Sponsors

Closed Thread
Results 1 to 6 of 6

Thread: Strings in php?

  1. #1
    Host Master
    Join Date
    Feb 2012
    Location
    In core
    Posts
    301

    Strings in php?

    I again got a doubt regarding strings I was viewing a example of php script which was using two different kind of string one with single quotes and other with double quote.So can anybody please tell me what is difference between single quoted and double quoted strings. please...

  2. #2
    Host Master
    Join Date
    Feb 2012
    Location
    In your CPU
    Posts
    299
    Basically their is one difference in single quoted and double quoted string it is that single quoted strings are not parsed whereas double quoted strings are parsed before echo.

  3. #3
    Host Master
    Join Date
    Feb 2012
    Location
    In core
    Posts
    301
    Is it the only difference between these two types of strings can you please give some example how I should use them.

  4. #4
    Super Noob
    Join Date
    Mar 2012
    Location
    USA - Hemilton
    Posts
    5
    In PHP there is not a specific way to define variable like Integer, Float, Double or String. In PHP you can declare a variable using $ sign. For Example
    Syntax: $variable_name=[value_of_variable];
    Example: $username="Alex";

  5. #5
    Host Master
    Join Date
    Feb 2012
    Location
    In core
    Posts
    301
    Thanks for bro for trying to helping me with string matter but I already know how a variable is declared in php but what I wanted to know whether there is any difference in single quoted string and double quoted strings.I think Thecreator difference is the only one which make these string different.If anybody knows of any other difference please let me know.

  6. #6
    Super Noob
    Join Date
    Mar 2012
    Location
    USA
    Posts
    5
    If you have to create a string variable in php then you have to simply declare a string variable using the dollar sing with the name of that variable. Like

    <?php
    $name_of_variable=[value_of_that_variable];
    ?>


 

Posting Permissions

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