数组有关问题.

WBOY
Release: 2016-06-13 11:55:26
Original
973 people have browsed it

数组问题...
代码如下

foreach ($url as $val){<br />	if ($netbot->fetchlinks($val)){<br />		$urlarray[] = $netbot->results;<br />	}else{<br />		echo "error :".$netbot->error;<br />		exit;<br />	}<br />}
Copy after login


这里的$url是一个数组,存放地址
通过snoopy的方法, $netbot->fetchlinks($val)来获取这个url的所有link
那么,我想把所有的link放在一个数组中

$netbot->results 返回的是一个一维数组

现在的问题是: $urlarray[] = $netbot->results;

这种方式赋值,会获得一个多维数组

里面的link只有他第一次访问url的links



我想让这个$urlarray下标自动转移.
在获取第二个url的时候,赋值时,可以继承上面的下标, 从而将$urlarray转化为1维数组,

这该如何实现呢?
------解决方案--------------------
楼主放弃了吗?
应该在if的第一个条件再循环

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!