PHP数组怎么获取最大值

preg_match_all("/src=\"\/?(.*?)\"/",$_content,$pos);print_r($pos);打印结果是:Array([0]=>Ar... preg_match_all("/src=\"\/?(.*?)\"/", $_content, $pos);
print_r($pos);
打印结果是:
Array
(
[0] => Array
(
[0] => src="/lib/kindeditor/php/../attached/image/20140811/20140811001239_52942.jpg"
[1] => src="/lib/kindeditor/php/../attached/image/20140811/20140811001239_96704.jpg"
[2] => src="/lib/kindeditor/php/../attached/image/20140811/20140811001239_22153.jpg"
[3] => src="/lib/kindeditor/php/../attached/image/20140811/20140811001239_62245.jpg"
[4] => src="/lib/kindeditor/php/../attached/image/20140811/20140811001240_26476.jpg"
)
[1] => Array
(
[0] => lib/kindeditor/php/../attached/image/20140811/20140811001239_52942.jpg
[1] => lib/kindeditor/php/../attached/image/20140811/20140811001239_96704.jpg
[2] => lib/kindeditor/php/../attached/image/20140811/20140811001239_22153.jpg
[3] => lib/kindeditor/php/../attached/image/20140811/20140811001239_62245.jpg
[4] => lib/kindeditor/php/../attached/image/20140811/20140811001240_26476.jpg
)
)
我想获取
[0] => lib/kindeditor/php/../attached/image/20140811/20140811001239_52942.jpg
[1] => lib/kindeditor/php/../attached/image/20140811/20140811001239_96704.jpg
[2] => lib/kindeditor/php/../attached/image/20140811/20140811001239_22153.jpg
[3] => lib/kindeditor/php/../attached/image/20140811/20140811001239_62245.jpg
[4] => lib/kindeditor/php/../attached/image/20140811/20140811001240_26476.jpg
这一段的最大值应该怎么做
展开
 我来答
我想淫笑
2014-08-11 · 超过26用户采纳过TA的回答
知道答主
回答量:126
采纳率:0%
帮助的人:57.6万
展开全部
用asort() 排列 显示数据从小到大 然后 end() 获取 最后位值
追问
preg_match_all("/src=\"\/?(.*?)\"/", $_content, $pos);
$my_array=end($pos);
$result=array_search(max($my_array),$my_array);
echo $result;
我这样取出了最大值~没用到asort()
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式