#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    10
    Rep Power
    0

    Concatenation problem.


    Could someone tell me why this does not work?
    PHP Code:
    <?php 
    $resultaat 
    "FJHBSFUJSGUBWSGVB";
     print 
    "<br /><p style=\"color:red\">" $resultaat; . "</p>"
    ?>
    It gives me the following error.
    Parse error: syntax error, unexpected '.' in C:\wamp\www\uria_nieuw\test.php on line 3
    Thanks in advance.
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    Hi,

    remove the semicolon. What is it doing there, anyway? A semicolon is for terminating statements.

    Comments on this post

    • Storm2012 agrees : thank you for the help.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    10
    Rep Power
    0
    Originally Posted by Jacques1
    Hi,

    remove the semicolon. What is it doing there, anyway? A semicolon is for terminating statements.
    Don't I need to terminate the print statement?

    Also after removing the semicolon the error I get is the same.
    PHP Code:
    <?php 
    $resultaat 
    "FJHBSFUJSGUBWSGVB"
    print 
    "<br /><p style=\"color:red\">" $resultaat; . "</p>" 
    ?>
  6. #4
  7. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,959
    Rep Power
    1014
    That's what I feared you would do ...

    I meant the inner semicolon right after the $resultaat. The semicolon after the print statement is of course correct and necessary.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    10
    Rep Power
    0
    Originally Posted by Jacques1
    That's what I feared you would do ...

    I meant the inner semicolon right after the $resultaat. The semicolon after the print statement is of course correct and necessary.
    No idea how I could have missed that one, let alone why I ever placed it there in the first place.

    Thanks for your help.

IMN logo majestic logo threadwatch logo seochat tools logo