Sign in to follow this  
Followers 0
Carl

Merge Variables

3 posts in this topic

How can I merge two variables? I need something like this:

$newvariable = $variable1 + "test" + $variable2

Share this post


Link to post
Share on other sites



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

[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Share this post


Link to post
Share on other sites

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
Thanks, I couldn't find that.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0