【发布时间】:2014-06-10 05:15:31
【问题描述】:
我在 mysql db 中有 longtext 列,并希望将其扩展为数组。但是 explode 只返回 1 个字符串。
$temp_array_links[] = $item->links; //array value: http://google.com/ http://test.com/ http://test1.com/
$temp_string = implode(" ", $temp_array_links); //convert array to string
$info_array_links = explode(" ", $test_string); //explode string
echo 'Your link: <a href="'. $info_array_links[$user_id--] .'">LINK</a>'; //should be http://google.com/ insted of http://google.com/ http://test.com/ http://test1.com/
【问题讨论】:
-
这不是mysql问题。
-
array(1) { [0]=> string(58) "google.com test.com test1.com" }
标签: php arrays explode implode