Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

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