Carl Posted April 17, 2006 Share Posted April 17, 2006 How can I merge two variables? I need something like this: $newvariable = $variable1 + "test" + $variable2 Link to comment Share on other sites More sharing options...
neogia Posted April 17, 2006 Share Posted April 17, 2006 If you want to "merge" numbers, use: $final = $var1 + $var2 If you want to "merge" strings, use: $final = $string1 & $string2 In your example, you would do this: $newvariable = $variable1 & "test" & $variable2 iamkoshr 1 [u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia Link to comment Share on other sites More sharing options...
Carl Posted April 17, 2006 Author Share Posted April 17, 2006 If you want to "merge" numbers, use: $final = $var1 + $var2 If you want to "merge" strings, use: $final = $string1 & $string2 In your example, you would do this: $newvariable = $variable1 & "test" & $variable2Thanks, I couldn't find that. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now