0
にforeachループ内の文字列の結果のすべてを置く私のコードです:私は$item['description']
は、ここに一つの変数
のforeachの結果を組み合わせること$item['description2'] .=
を使用
include('simple_html_dom.php');
$html = file_get_html('http://www.exampel.com');
foreach($html->find('item') as $article) {
$item['title'] = $article->find('title', 0)->innertext;
$item['description'] = $article->find('description', 0)->innertext;
$item['description2'] .= $item['title'] .' : '. $item['description'] .'<br>';
$articles[] = $item;
}
echo $item['description2'];
は働いていたエコーが、私は"Notice: Undefined index: description2"
を得ました何が問題ですか?
ループの結果をそれぞれ$item['description']
に1つの変数に入れる方法は?
ありがとうございます。 –
あなたは大歓迎です! –