|
-
Aug 28th, 2001, 06:17 PM
#1
Thread Starter
Fanatic Member
PHP again - String concatenation
How can I concatenate two variables as strings? For example,
PHP Code:
$a = "asdf";
$b = "ghjk";
fwrite($theFile, ???); //want to have asdfghjk
Alcohol & calculus don't mix.
Never drink & derive.
-
Aug 28th, 2001, 08:17 PM
#2
you can try" join($a,$b) "
-
Aug 28th, 2001, 08:36 PM
#3
actually that would be
PHP Code:
$a = "asdf";
$b = "ghjk";
$c = join("",$a$b)
fwrite($theFile, $c); //want to have asdfghjk
I think that would work since I didn't see any other function that would do it besides implode(), which is the same.
-
Aug 28th, 2001, 10:47 PM
#4
That can be simplified:
Code:
$a = "Hello ";
$b = "World";
$c = $a . $c;
//or
$a = "Hello";
$b = "World";
$c = "$a $b";
-
Aug 28th, 2001, 11:14 PM
#5
I was thinking that but wasn't sure if that would work,
-
Aug 29th, 2001, 03:00 PM
#6
Thread Starter
Fanatic Member
Cool, thanks guys
Alcohol & calculus don't mix.
Never drink & derive.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|