我正在尝试将从数据库数组中检索到的段落分解为单独的单词。这是做这件事的正确方法吗,因为它目前给出一个错误,说explode() 需要2 个参数,所以它一定不能拾取$row 数组。
function words() {
$query = mysql_query("SELECT text FROM table WHERE textID = 1");
while($row = mysql_fetch_array($query)) {
$e[] = explode(" ", $row);
foreach($e as $r) {
echo $r;
}
}
}