2011-06-25 50 views
0

可以說我有這個變量:插入值的數組內

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

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

我如何可以插入$build_1$build_2$build_total第三個變量的內容?

之後,我想在0123數據庫中插入$build_total,並獲得'磚塊,石塊和其他東西,更多的磚塊,房屋和其他東西'。

+5

你在說什麼數組在哪裏? – Tomalak

回答

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

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

如果$ build_1和$ build_2在數組中,則可以使用implode-方法。

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