Jump to content
Sign in to follow this  
Carl

Merge Variables

Recommended Posts

Carl

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
neogia

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
Carl

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  

×