I'm trying to breakdown a paragraph, retrieved from a database array, into separate words. Is this the right way to go about doing it because it is currently giving an error saying explode() expects 2 parameters, so it must not be picking up the $row array.
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;
}
}
}
function words() {
$query = mysql_query("SELECT text FROM table WHERE textID = 1");
while($row = mysql_fetch_array($query)) {
$e[] = explode(" ", $row[0]);
foreach($e as $r) {
echo $r;
}
}
}
$row is array. Choose first element to explode. Read documentation for Explode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With