0

Lets say I have this variables:

$build_1 = 'bricks, stones and other stuff';

$build_2 = 'more bricks, houses and other things';

How can I insert the content of $build_1 and $build_2 in a third variable like $build_total?

After that, I want to insert $build_total inside a mysql database and get 'bricks, stones and other stuff, more bricks, houses and other things'.

1
  • 5
    And where is the array you're talking about? Commented Jun 25, 2011 at 21:40

3 Answers 3

2
$build_total = $build_1 . ', ' . $build_2;

?

Sign up to request clarification or add additional context in comments.

Comments

1
$build_total = $build1 . ", " . $build2;

Comments

0

If $build_1 and $build_2 would be in an array, you could use the implode-method.

<?php
$build = array("bricks, stones and other stuff", "more bricks, stones and other stuff");
$build_total = implode(", ", $build);
?>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.