Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Combining two strings together in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 259
    Comment on it

    Combining of multiple using to add up one single can be achieve by various ways

    In PHP you can either join then by using (.) Concatenate Operator or by using String Interpolation:

    We'll do both of way here

    Let's consider two stings

    $one_string = "I'm the first string on you line" ;
    $two_string = "and I'm the last on your line" ;
    

    By using (.) the code will go like this:

    $join_string = $one_string . $two_string ;
    

    Secondly you can use string interpolation and then code will go like this

    $join_string = $one_string . ' ' . $two_string ;
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: