SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to writ php variable

    Hi....guy s

    i am beginner.

    some doubts php variable

    how s arrangement two variable data store a single variable




    thanks

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Hi.

    I'm having some trouble understanding you, but does this help?

    PHP Code:
    <?php
    $forename 
    'Anthony';
    $surname 'Sterling';

    echo 
    $forename' '$surnamePHP_EOL ;
    /*
      Anthony Sterling
    */
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my doubts

    <?php
    $myvariable="test";
    echo $myvariable;
    $myvariable2="book";
    echo $myvariable2;
    $bigvariable="$myvariable""$myvariable2";
    echo$bigvariable;
    ?>

    two variable store a single variable
    how s proper syntax

  4. #4
    SitePoint Evangelist venkat6134's Avatar
    Join Date
    Jul 2010
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php
    $myvariable="test";
    echo $myvariable; // displays test
    $myvariable2="book";
    echo $myvariable2; // displays book
    $bigvariable=$myvariable.$myvariable2;
    echo $bigvariable;// displays testbook
    ?>

  5. #5
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my problem solve

    thanks

    $bigvariable=$myvariable.$myvariable2;


Bookmarks

Posting Permissions

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