list.txtとしてテキストファイルがあります。list.txtの内容は次のとおりです。
user1:site1.com
user2:site2.com
user3:site3.com
user4:site4.com
私は次のコードを使用しました:
$a=file('list.txt');
foreach ($a as $final) {
list($user, $site) = explode(":", $a);
echo ($user." is the user of ".$site);
}
出力を表示したい:
user1 is the user of site1.com
user2 is the user of site2.com
user3 is the user of site3.com
user4 is the user of site4.com
誰かが私の問題を解決できますか。私はphpの初心者です。配列関数に問題があります。