您好朋友我的代码如下: 在这里,我正在迭代for循环
foreach($row_result as $results)
{
$f = fopen("jigsaw.csv", "a+");
$new_array = array();
$content = $results->findElement(WebDriverBy::className('seo-company'))->geTtext();
$test = array();
if($i==1)
{
$Orgnisation_name = $content;
$concate = array_push($test,$Orgnisation_name);
echo "\n";
}
if($i==2)
{
echo $Website = $content;
echo "\n";
}
if($i==3)
{
echo $HeadQuarters = $content;
echo "\n";
}
if($i==4)
{
echo $Phone = $content;
echo "\n";
}
if($i==5)
{
echo $Industries = $content;
echo "\n";
}
if($i==6)
{
echo $Employees = $content;
echo "\n";
}
if($i==7)
{
echo $Revenue = $content;
echo "\n";
}
if($i==8)
{
echo $Ownership = $content;
echo "\n";
}
$i++;
}
答案 0 :(得分:2)
答案 1 :(得分:1)
你需要使用array_push吗? $concate = array_push($test,$Orgnisation_name);
$ test此时为空。如果您只想将项添加到$ concate数组,$concate[] = $Orgnisation_name;
就足够了。