Loading...

PHP如何將陣列組合接成字串

Temperature: 0 °C

ChungChung
author_tools

$arr = array('hello','word');
echo implode(" ",$arr);

上列範例得到的結果是 hello word

PHP join 函數的功能是可以把 PHP Array 內的陣列元素組合為一個字串,效果與 implode 函數是一樣的,所以若是使用join,得到的結果也是一樣的。
字串 = implode( 組合字符 , Array );

字串 = join( 組合字符 , Array );

每個元素之間,會以引數所指定的﹝分隔符號﹞所連結。

https://innstory.com/story-PHP如何將陣列組合接成字串-630
寫程式筆記

Prev
 綠島長慶民宿2016年版

Next
檳城美食系列爪哇麵 

About the Author

Chung

我是chung
網路工作者
主業是網站系統開發建置
副業是做夢,寫故事
作品請參考/teme.biz
做夢請參考/innstory.com
聯絡/chung.teme@gmail.com

#有人用筆寫日記,有人用歲月寫日記,有人用照片寫日記,而我,用innstory寫日記。

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

CentOS 5.2 使用 YUM 將 PHP 5.1.6 更新到 5.2.6

CentOS 5.2 使用 ...

CentOS 5. 版內建的 PHP 版本為 5..,甚至於 5. 版仍舊是 5.. 版本。 基於系...

HTML5 Geolocation

HTML5 Geolocat...

說真的,HTML5 Geolocation的功能真的好用... 輕鬆就可以讓網站也能取得目前所在的地...

判斷捲軸的位置

判斷捲軸的位置

當捲軸往下移動時,判段目前移動到哪個位置... Javascript部份 $(function(){...

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format