$allMessages = array();
if ($file = fopen("messages.txt", "r")) {
while(!feof($file)) {
$line = fgets($file);
$parts = explode(", ", $text);
array_push($allMessages, $parts);
}
fclose($file);
}
echo '<pre>';
print_r($allMessages);
echo '</pre>';
i did this but it returned an empty string idk what happened
##returned Array ( [0] => Array ( [0] => )
[1] => Array
(
[0] =>
)
[2] => Array
(
[0] =>
)
[3] => Array
(
[0] =>
)
[4] => Array
(
[0] =>
)
)
btw the file consist of
names, message
(it is separated by comma)
it splits it by the explode
function but it returned empty string
pls help meh