SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,211
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Stting a variable and Printing it

    I like to make a variable which contains "myText," and print it in PHP


    I wrote the following code, expecting following target browsing result.
    Code:
    code
    
    <?php
    $myString='myText'
    
    echo $myString ;
    ?>
    
    target browsing result
    
    myText
    
    actual result
    
    Parse error: parse error, unexpected T_ECHO in 
    c:\apm_setup\htdocs\test\03.php on line 7
    How can I modify the code above for getting my target result above instead of parse error?

  2. #2
    Dinah-Moe Humm mudshark's Avatar
    Join Date
    Dec 2003
    Posts
    1,072
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    $myString 
    'myText';
    echo 
    $myString;
    ?>
    Forgot the closing semicolon on line one.

  3. #3
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,211
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much, mudshark.


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
  •