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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

putting two strings together in php..?

  • 18-04-2001 6: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