<?php
function getKeywordSuggestionsFromGoogle($keyword) {
$keywords = array();
$data = file_get_contents('
http://suggestqueries.google.c...l=en-US&q='.urlencode( 
$keyword));
if (($data = json_decode($data, true)) !== null) {
$keywords = $data[1];
}
return $keywords;
}
var_dump(getKeywordSuggestionsFromGoogle('thaiseo'));
?>
ผลลัพธ์ได้ออกมาแบบนี้ครับ
array(7) { [0]=> string(12) "thaiseoboard" [1]=> string(15) "thaistockmarket" [2]=> string(15) "thaiseo godaddy" [3]=> string(18) "thaiseoboard index" [4]=> string(14) "thaiseo market" [5]=> string(19) "thaiseoboard pantip" [6]=> string(19) "thaiseoboard amazon" }ซึ่งผมต้องการให้ออกมา แบบไม่ใช่ array เช่น keyword1,keyword2,....
ผมใส่ jason_decode ลงไปแล้วใน code แต่ไม่ทราบว่าผิดตรงไหนครับ ทำไม output จึงออกมาในรูปแบบ array
ขอบคุณครับ
