Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

putting two strings together in php..?

  • 18-04-2001 07:40PM
    #1
    Registered Users, Registered Users 2 Posts: 2,518 ✭✭✭


    ok heres the problem. I have a string I want to add onto the start of another string in php.

    basically i have the end part of the email address "@somthing.com" and i want to add a value (entered by the user in a form) onto it.

    I'm sure theres some concatenation functions that can do this?


Comments

  • Registered Users, Registered Users 2 Posts: 2,518 ✭✭✭Hecate


    ah..it be fixed now smile.gif


  • Registered Users, Registered Users 2 Posts: 380 ✭✭dogs


    (i know the problems solved, may as well answer though :) )
    php uses the . operator, just like perl for combining strings
    $email = $username . "@example.com";
    $email = "$username@example.com";
    
    will both work (but the first is a better option really)


Advertisement